Welcome to WebmasterWorld Guest from 54.196.175.173

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Is this htaccess OK?

webhosts saying there's a problem!

     

lee_sufc

9:45 pm on Jun 10, 2008 (gmt 0)

10+ Year Member



I have a problem on my site and my webhosts are blaming my htaccess file. However, I am fairly sure there is nothing wrong with it.

Is it possible for an expert here to check the following:


RewriteEngine On
RewriteCond %{HTTP_HOST} ^example\.com [NC]
RewriteRule (.*) http://www.example.com/$1 [R=301,L]
#
#####################################################
# FORUM
RewriteRule ^forum/forum([0-9]+)\.html$ /forum/viewforum.php?f=$1 [QSA,L]
# TOPIC
RewriteRule ^forum/topic([0-9]+)\.html$ /forum/viewtopic.php?t=$1 [QSA,L]
#####################################################
#
Redirect 301 /Contact_Us.htm http://www.example.com/Contact_Us.php
Redirect 301 /Links2.htm http://www.example.com/Links.htm
Redirect 301 /Links3.htm http://www.example.com/Links.htm
Redirect 301 /worldwide_resources.htm http://www.example.com/Links.htm
Redirect 301 /Linktous.htm http://www.example.com/Links.htm
Redirect 301 /Why_choose_us.htm http://www.example.com/about.htm

[edited by: jdMorgan at 2:15 pm (utc) on June 12, 2008]
[edit reason] example.com [/edit]

jdMorgan

2:16 pm on Jun 12, 2008 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



> I have a problem on my site and my webhosts are blaming my htaccess file.

What kind of problem? Knowing this might help focus the examination of your code. It looks OK to me, but I don't know what kind of problem I might be looking for!

Jim

g1smd

11:14 am on Jun 13, 2008 (gmt 0)

WebmasterWorld Senior Member g1smd is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



Some things here.

I would not mix directives from different modules. To do so means you cannot guarantee which order the rules will be processed.

I would avoid mixed case URLs and I never use an underscore in a URL.

Your existing code may lead to a redirection chain for some of the URLs you list.
Trace what happens when you request example.com/Contact_Us.htm for example.

Finally, you don't need to change some URLs from .htm to .php. You can either use a rewrite (not a redirect) to connect the .htm URL to the equivalent .php file on the server, or you can force .htm files to be parsed for PHP scripting.

 

Featured Threads

Hot Threads This Week

Hot Threads This Month