Anyone know why my homepage won't load with the www prefix.

Links such as


will load fine



returns a 404.

Every page works including the home page if I leave out the www. The site has CMS Made Simple in the backend and has a root_url set without the www. The DNS has a CNAME to the www too.

As Requested here is the .htaccess:

RewriteEngine On

RewriteRule ^gallery(/((([a-zA-Z0-9-]+)(/(\d+))?)/?)?)?$ index.php?page=77&groupId=$4&showpage=$6 [NC,QSA,L]

RewriteCond %{REQUEST_FILENAME} !-f [NC]
RewriteCond %{REQUEST_FILENAME} !-d [NC]
RewriteRule ^(.+)$ index.php?page=$1 [NC,QSA,L]
  • 1
    Can you post the contents of your .htaccess? Otherwise it's entirely speculation...
    – ianhales
    Oct 14 '11 at 15:27
  • 1
    Could this be it?: "...has a root_url set without the www"
    – Sparky
    Oct 14 '11 at 15:32
  • It depends on the 404 generated. If it's handled by the CMS and outputted accordingly, then that's a likely possibility. If it's a raw server 404, then the CMS settings shouldn't make any difference.
    – ianhales
    Oct 14 '11 at 15:36
  • its a raw 4040 generated by the host and not the one generated by the cms. i tried the root_url with the www but it makes no difference.
    – jiraiya
    Oct 14 '11 at 15:39
  • It appears that you need to set correct CNAME www to @ And then wait until DNS propagation.
    – arma
    Oct 14 '11 at 15:44

Might it be the fact that you have a last rewrite flag on the first rule? I would remove the L from [NC, QSA, L].

RewriteRule ^gallery(/((([a-zA-Z0-9-]+)(/(\d+))?)/?)?)?$ index.php?page=77&groupId=$4&showpage=$6 [NC,QSA,L]

I believe the L flag will stop the rules below from being parsed, may be wrong though? We have any .htaccess wiz's out there?

  • That rule would only apply to gallery pages, and the L flag only stops mod_rewrite if the rule matches. So it's not the problem. The problem was a DNS propagation error as specified in the comments. The OP just chose not to post that solution and accept it as an answer. Dec 8 '11 at 23:06

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy