News + mod_rewrite. Getting URL in required search engine friendly format
Posted: Thu Nov 02, 2006 12:37 am
Hello everyone.
I am new to CMSMS but so far I LOVE IT.
I am moving the existing site to a CMSMS and having some troubles with getting search engine friendly URLS for the news section.
I desperately need your help!
I am using:
CMS Made Simple 1.0.2 "Maui"
News 2.1
Apache 2.0
PHP 4.4.2
MySQL 4.1.18
ModRewrite is ON
config.php settings:
however I added:
to the beginning of News.module.php and action.default.php
My .htaccess file look like this:
That way I got all my content pages URLs of the website to match the existing website so when I switch my search engine ranking won't be lost.
The news pages however, are exactly how they expected to be ( /news/14/63.cfm ) , but not how I need them (and it is a MUST, my head is spinning, and I can't make it work!!! help!).
So I found this topic:
http://forum.cmsmadesimple.org/index.ph ... 012.0.html
This solution should have provided me with acceptable results.
However, it just didn't work. It displayed the link structure in the format it acceptable, but news details page never showed up. Instead it troughs the browser back to either home page or the news list page.
The desired URL structure is:
http://www.balh.com/whatever/title-of-the-news.cfm
or
http://www.balh.com/whatever/00/00/titl ... e-news.cfm
or something along this lines...
The most important part is to have lower case dash separated /title-of-the-news-article.cfm at the end of URL, and preferably as little as possible directory inclusions (ie /00/00/00/...)
I am suspecting that it is the mod_rewrite issue. But I am clueless how to fix it up.
I've been on it for 4 days and I am so lost. It is crucial to have the URLs this way for Search Engine Optimization purposes.
Can someone please help me?
You can view the development site at: http://www.asfdesign.com/home-test.cfm
Thank you!
Dmitri
ASF Design Inc : Search Engine Optimization and Search Engine Marketing firm
I am new to CMSMS but so far I LOVE IT.
I am moving the existing site to a CMSMS and having some troubles with getting search engine friendly URLS for the news section.
I desperately need your help!
I am using:
CMS Made Simple 1.0.2 "Maui"
News 2.1
Apache 2.0
PHP 4.4.2
MySQL 4.1.18
ModRewrite is ON
config.php settings:
Code: Select all
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.cfm';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = false;
Code: Select all
$config['use_hierarchy'] = true;
My .htaccess file look like this:
Code: Select all
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
RewriteCond %{REQUEST_URI} !/$
RewriteCond %{REQUEST_URI} !\.
RewriteRule ^(.*) %{REQUEST_URI}/ [R=301,L]
# Rewrites urls in the form of /parent/child/
# but only rewrites if the requested URL is not a file or directory
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
The news pages however, are exactly how they expected to be ( /news/14/63.cfm ) , but not how I need them (and it is a MUST, my head is spinning, and I can't make it work!!! help!).
So I found this topic:
http://forum.cmsmadesimple.org/index.ph ... 012.0.html
This solution should have provided me with acceptable results.
However, it just didn't work. It displayed the link structure in the format it acceptable, but news details page never showed up. Instead it troughs the browser back to either home page or the news list page.
The desired URL structure is:
http://www.balh.com/whatever/title-of-the-news.cfm
or
http://www.balh.com/whatever/00/00/titl ... e-news.cfm
or something along this lines...
The most important part is to have lower case dash separated /title-of-the-news-article.cfm at the end of URL, and preferably as little as possible directory inclusions (ie /00/00/00/...)
I am suspecting that it is the mod_rewrite issue. But I am clueless how to fix it up.
I've been on it for 4 days and I am so lost. It is crucial to have the URLs this way for Search Engine Optimization purposes.
Can someone please help me?
You can view the development site at: http://www.asfdesign.com/home-test.cfm
Thank you!
Dmitri
ASF Design Inc : Search Engine Optimization and Search Engine Marketing firm