I am running CMSMS 1.0.8 on Apache 2.0.52.
I have pretty urls working using the mod_rewrite method. I want to add a coexisting rewrite rule to redirect all traffic for mydomain.{com,net} to mydomain.org while preserving pretty urls.
When placing the canonical hostname rewrite rule before the pretty url rule, I get the 404 error page when visiting http://www.mydomain.com.
Code: Select all
RewriteEngine On
# canonical host name
RewriteCond %{HTTP_HOST} !^www\.mydomain\.org [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule .* http://www.mydomain.org$1 [R=301]
#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
#Error Pages
ErrorDocument 404 /invalid-address
Code: Select all
RewriteEngine On
#Rewrites page.shtml as index.php?page
RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
# canonical host name
RewriteCond %{HTTP_HOST} !^www\.mydomain\.org [NC]
RewriteCond %{HTTP_HOST} !^$
RewriteRule .* http://www.mydomain.org$1 [R=301]
#Error Pages
ErrorDocument 404 /invalid-address
Could anyone point me in the right direction?
Thank you!
- Michael