Thread: Redirect Issue
View Single Post
Old 07-17-2012, 10:11 PM   PM User | #1
mathceleb
Regular Coder

 
Join Date: Mar 2010
Posts: 235
Thanks: 39
Thanked 6 Times in 6 Posts
mathceleb is an unknown quantity at this point
Redirect Issue

When we use the following .htaccess the site will redirect properly for a few minutes then it just stops responding. Essentially, we want to redirect non-www requests to the www handle.

Code:
BrowserMatchNoCase Apache-HttpClient/4.0.1 bad_bot
Order Deny,Allow
Deny from env=bad_bot

# Don't show directory listings for URLs which map to a directory.
Options -Indexes

# Follow symbolic links in this directory.
Options +FollowSymLinks

RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mysite\.com
RewriteRule (.*) http://www.mysite.com/$1 [R=301,L] 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
mathceleb is offline   Reply With Quote