I have a base installation of 1.6.6. located in a sub folder www.domain.com/cms
I have set .httaccess as:
# Options +FollowSymLinks
RewriteEngine on
RewriteBase /cms/
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
# RewriteCond %{REQUEST_URI} !/$
# RewriteCond %{REQUEST_URI} !\.
# RewriteCond %{REQUEST_METHOD} !POST$
# 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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)(.html)?$ index.php?page=$1 [QSA]
I have set config.php:
$config['url_rewriting'] = 'mod_rewrite';
$config['page_extension'] = '.html';
$config['use_hierarchy'] = true;
$config['query_var'] = 'page';
I want to create URLs as: www.domain.com/cms/page_name.html
When I hover over a link I see the correct www.domain.com/cms/page_name.html
When I click a link I get an error 404
If I click the home icon, it works correctly and goes back to www.domain.com/cms
I have several earlier versions (1.5.4) of CMSMS running on the same host and Pretty URLs are working happily.
Any ideas?!?
Cheers,
Marc
SOLVED - Pretty URLs and mod_rewrite = 404
SOLVED - Pretty URLs and mod_rewrite = 404
Last edited by mjcp on Sat Nov 07, 2009 11:59 am, edited 1 time in total.
Re: Pretty URLs and mod_rewrite = 404
Try with this .htaccess (source http://wiki.cmsmadesimple.org/index.php ... And_Tricks):mjcp wrote: I have a base installation of 1.6.6. located in a sub folder www.domain.com/cms
I have set .httaccess as:
AlbyOptions +FollowSymLinks
RewriteEngine on
RewriteBase /cms
# 301 Redirect all requests that don't contain a dot or trailing slash to
# include a trailing slash
# except for form POSTS
# RewriteCond %{REQUEST_URI} !/$
# RewriteCond %{REQUEST_URI} !\.
# RewriteCond %{REQUEST_METHOD} !POST$
# 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
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+).htm$ index.php?page=$1 [QSA]
SOLVED - Re: Pretty URLs and mod_rewrite = 404
Thanks,
I pasted your .htt version and changed .html to .htm in config.pho and it worked! Have now changed both to .html and it's still going strong.
I think my errors were:
1. In the RewriteBase I have /cms/ you had /cms (no trailing / )
2. You had RewriteRule ^(.+).htm$ index.php?page=$1 [QSA]
I had RewriteRule ^(.+)(.html)?$ index.php?page=$1 [QSA] (no "( )?" around the .html )
Many thanks!
Marc
I pasted your .htt version and changed .html to .htm in config.pho and it worked! Have now changed both to .html and it's still going strong.
I think my errors were:
1. In the RewriteBase I have /cms/ you had /cms (no trailing / )
2. You had RewriteRule ^(.+).htm$ index.php?page=$1 [QSA]
I had RewriteRule ^(.+)(.html)?$ index.php?page=$1 [QSA] (no "( )?" around the .html )
Many thanks!
Marc