Welcome to WebmasterWorld Guest from 54.145.15.88

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

Is this htaccess OK?

webhosts saying there's a problem!

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

Full Member

10+ Year Member

joined:Aug 16, 2004
posts:299
votes: 0


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]

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

Senior Member

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

joined:Mar 31, 2002
posts:25430
votes: 0


> 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

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

Senior Member

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

joined:July 3, 2002
posts:18903
votes: 0


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.

 

Join The Conversation

Moderators and Top Contributors

Hot Threads This Week

Featured Threads

Free SEO Tools

Hire Expert Members