homepage Welcome to WebmasterWorld Guest from 54.211.138.180
register, free tools, login, search, subscribe, help, library, announcements, recent posts, open posts,
Pubcon Website
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
Is this htaccess OK?
webhosts saying there's a problem!
lee_sufc




msg:3671617
 9:45 pm on Jun 10, 2008 (gmt 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]

 

jdMorgan




msg:3673032
 2:16 pm on Jun 12, 2008 (gmt 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

g1smd




msg:3673938
 11:14 am on Jun 13, 2008 (gmt 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.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About
© Webmaster World 1996-2014 all rights reserved