Closed (duplicate)
Project:
Drupal core
Version:
5.1
Component:
base system
Priority:
Normal
Category:
Bug report
Assigned:
Unassigned
Reporter:
Created:
10 Jul 2007 at 18:27 UTC
Updated:
11 Jul 2007 at 21:22 UTC
I found the rewrite rules a bit buggy in Drupal 5.1. I discovered a suggestion that corrects the bad behavior. Simply add a $1 to the rewrite rule. Please update as follows:
# If you want the site to be accessed WITH the www. only, adapt and
# uncomment the following:
# RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
# RewriteRule .* http://www.example.com/$1 [L,R=301]
#
# If you want the site to be accessed only WITHOUT the www. prefix, adapt
# and uncomment the following:
# RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
# RewriteRule .* http://example.com/$1 [L,R=301]The $1 simply tacks on the rest of the URL originally submitted to the server. This way the person browsing does not end up at the home page... www. is simply / silently added/removed from the URL. aaaahhhh....
Comments
Comment #1
mdlueck commentedWell, this solution seems to be buggy at one site. Best link you with the doc that put us onto a solution to this problem as the rewrite rules they suggest do work on this particular domain.
(shrug)
http://drupal.org/node/64645
So two suggested fixes. At least there is the possibility of fixing the annoying Drupal default behavior.
Comment #2
webernet commentedDuplicate of: http://drupal.org/node/109150
Comment #3
mdlueck commentedThanks so much for pointing us to the solution ready for commit. Successfully implemented on our Drupal 5.1 servers.