Forum Moderators: phranque

Message Too Old, No Replies

.htaccess file help

I broke my website by changing it.... ooops?

         

rj87uk

4:13 pm on Mar 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



So looking for some help here guys.

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 on

RewriteRule ^([^/\.]+)/?$ /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

jdMorgan

7:00 pm on Mar 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Now all I done was copy the second two lin[e]s of the first .htaccess file over into this one, and broke it...

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

rj87uk

8:05 pm on Mar 20, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Hi Jim,

The error is:

Error 404: File Not Found

The 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?

jdMorgan

1:25 pm on Mar 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



That's not a server error log entry, that's a browser error page. Also, we need to know how you tested --What URL you requested-- to get that error. The more details you provide, the faster the problem will be solved. Otherwise, we are simply guessing, which is wasteful of time and resources.

Jim

phranque

9:51 pm on Mar 21, 2007 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



Did 6-foot flames and black smoke belch out of the server? Or was it white or grey smoke?

a new jdM classic!
don't forget blue...

jdMorgan

2:18 pm on Mar 22, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Well, it wasn't my intention to take this thread off-topic, but rather to explain (hopefully, with humor) what it's like not being able to look over the OP's shoulder to see what's going on and to pass along a productive and efficient remote-debugging technique.

Any progress, rj87uk?

Jim