I have installed and setup cmsms in the root directory of my client's server - and it appears to be working fine.
Before I added CMSMS to the server, the site could be seen at http://www.... and http://… (non-www).
And in .htaccess I forced any non www page to redirect to a www page to prevent duplicate content in search engines:
# redirect non www to www to prevent duplicate content in search engines
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.domain.com$
RewriteRule ^(.*)$ http://www.domain.com/$1 [R=301]
Now (even with the above code in htaccess) with the CMSMS site, if you try the non www version it returns an error. (the www url works fine)
I have this is in config.php:
$config['assume_mod_rewrite'] = true;
$config['page_extension'] = '.php';
$config['internal_pretty_urls'] = false;
$config['use_hierarchy'] = true;
The ability to type the non www prefix and arrive at the correct page is preferable (as often people don’t type the www prefix in when looking for a site - I know I don’t).
I have lost the ability to do any 301 redirects through htaccess now that cmsms has been installed and its driving my crazy.
Any ideas on how I can make this work?
Perhaps I should turn mod rewrite off and do it manually through htaccess?
Thank you in advance for your help.
[solved] site no longer visible at http://www and http:// since cmsms install
[solved] site no longer visible at http://www and http:// since cmsms install
Last edited by nickf on Thu May 15, 2008 8:19 am, edited 1 time in total.
Re: site no longer visible at http://www and http:// since cmsms install
Which error?Now (even with the above code in htaccess) with the CMSMS site, if you try the non www version it returns an error. (the www url works fine)
Maybe a good idea, to change "[R=301]" to [R=301,L]".(even with the above code in htaccess)
You should also escape the dots in the RewriteCond with a backslash.
-
- Support Guru
- Posts: 8169
- Joined: Tue Oct 19, 2004 6:44 pm
- Location: Fernie British Columbia, Canada
Re: site no longer visible at http://www and http:// since cmsms install
and check your config.php
Follow me on twitter
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Please post system information from "Extensions >> System Information" (there is a bbcode option) on all posts asking for assistance.
--------------------
If you can't bother explaining your problem well, you shouldn't expect much in the way of assistance.
Re: site no longer visible at http://www and http:// since cmsms install
Hello,
wiedmann - sorry the error is a 301 "Moved Permanently. The document has moved here (with an incorrect link).
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request."
I added the [R=301,L] ad it works a treat!!!
You should also escape the dots in the RewriteCond with a backslash, do you mean like this?
RewriteCond %{HTTP_HOST} !^www.domain.com$
RewriteRule ^(./*)$ http://www.domain.com/$1 [R=301,L]
calguy 1000 - when you say check the config.php, please elaborate as I am not sure what to look for.
sorry for my basic questions, I am a css designer not a php coder and some of this cmsms appears to be not so simple for me.
thanks guys!!
wiedmann - sorry the error is a 301 "Moved Permanently. The document has moved here (with an incorrect link).
Additionally, a 400 Bad Request error was encountered while trying to use an ErrorDocument to handle the request."
I added the [R=301,L] ad it works a treat!!!
You should also escape the dots in the RewriteCond with a backslash, do you mean like this?
RewriteCond %{HTTP_HOST} !^www.domain.com$
RewriteRule ^(./*)$ http://www.domain.com/$1 [R=301,L]
calguy 1000 - when you say check the config.php, please elaborate as I am not sure what to look for.
sorry for my basic questions, I am a css designer not a php coder and some of this cmsms appears to be not so simple for me.
thanks guys!!