Forum Moderators: phranque
I have a htaccess file in my root directory that I hope has been redirecting the www. non www problem.
RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.co.uk$ [NC]
RewriteRule ^(.*)$ http://www.example.co.uk/$1 [R=301,L]
So all good i hope, however I have a directory called /example/ and i have another .htaccess file in there that does some url rewriting.
Options +FollowSymlinks
RewriteEngine onRewriteRule ^([^/\.]+)/?$ /example/index.php?page=regions&r=$1 [NC]
RewriteRule ^loans/search/?$ /example/index.php?page=search [NC]
RewriteRule ^([^/\.]+)/([^/\.]+)/?$ /example/index.php?page=towns&r=$1&t=$2 [NC]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ /example/index.php?page=show&r=$1&t=$2&n=$3&id=$4 [NC]
RewriteRule ^([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/([^/\.]+)/?$ /example/index.php?page=show&r=$1&t=$2&n=$3&id=$4&s=$5 [NC]
Now all I done was copy the second two links of the first .htaccess file over into this one, and broke it so at the moment everything is working however I would like to find out how i could make the same redirect from the non www. to www. in the above .htaccess file.
Not looking for the answer looking to bette understand it as I have no idea how the above files work, I tried to learn it before but my head doesn't understand.
RJ
Please define 'broke it' so we don't have to waste time typing all of the possibilities that don't apply.
1) Did you get a server error? If so, what's in the server error log file?
2) Did it redirect incorrectly? If so, where to and how is that wrong?
3) Did 6-foot flames and black smoke belch out of the server? Or was it white or grey smoke?
Thanks,
Jim
The error is:
Error 404: File Not FoundThe requested page is not found. This may happen due to the following reasons:
* Page or file is outdated, renamed, moved, or does not exist.
* You typed the address incorrectly, like www .example.com/pgae.html instead of www .example.com/page.html
So its a 404 error, However the URL was correct. Does that help or not really?