|
|

01-31-2009, 03:29 PM
|
|
Senior Member
|
|
Join Date: May 2007
Posts: 237
|
|
rewrite redirect not working under 3.3.24
This used to work and I just noticed under 3.3.24 it's no longer working:
RewriteCond %{HTTP_HOST} !^websitename\.com
RewriteRule ^(.*)$ http://websitename.com/$1 [L,R]
(it's to enforce no-www on URLs)
Works fine under apache, used to work under Litespeed.
Did something break?
|

01-31-2009, 04:32 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,603
|
|
|
Please enable rewrite log with "RewriteLogLevel 9" for that vhost.
It should not be affected.
|

01-31-2009, 05:54 PM
|
|
Senior Member
|
|
Join Date: May 2007
Posts: 237
|
|
Okay I did that (by the way, it would be nice if that worked from .htaccess as well, though I guess it would be a security issue as it could overflow the logs)
but there are no errors, only this info line, when I access it with www.websitename.com (it should be redirected to websitename.com but it's not)
2009-01-31 20:49:48.900 INFO [12.34.56.78:2594-4#APVH_websitename.com] [REWRITE] Cond: Match 'websitename.com' with pattern '^websitename\.com', result: 1
Last edited by aww; 01-31-2009 at 05:56 PM..
|

01-31-2009, 06:14 PM
|
|
Senior Member
|
|
Join Date: May 2007
Posts: 237
|
|
|
Hmm, wait now I see
12.34.56.78:2822-1#APVH_websitename.com] [REWRITE] Cond: Match 'www.websitename.com' with pattern '^websitename\.com', result: -1
So that's false, then there's a ! in front of it to negate it and that should be true.
But it doesn't seem to ever execute the redirect.
|

01-31-2009, 08:04 PM
|
|
Senior Member
|
|
Join Date: May 2007
Posts: 237
|
|
|
I tried something in a different directory that had no other rules and yes it works.
But that means a lower level rule is interfering with a higher level rule which should not happen.
the .htaccess in the webroot should execute first, before any in a sub-directory, no?
keep in mind it works on apache - I will have to look at this line by line now to debug
|

01-31-2009, 08:17 PM
|
|
Senior Member
|
|
Join Date: May 2007
Posts: 237
|
|
|
Yup with JUST that rule in the webroot, some lower level rules which have nothing to do with external redirects, only internal rewrites, screw it up - it never redirects.
I'll try to come up with a minimal example.
|

01-31-2009, 08:23 PM
|
|
Senior Member
|
|
Join Date: May 2007
Posts: 237
|
|
I have found the bug, and it is real.
All it takes is for a sub-directory to have the directive:
RewriteEngine On
in it's own sub .htaccess, and the parent redirect will never happen.
No other rule is present in the subdirectory.
If I remove that RewriteEngine On - the redirect will work properly, even with other rules.
Apparently "RewriteEngine On" causes the rewrite engine in litespeed to reset.
This is not the behaviour in apache, which will ignore it if it's already on.
Try making a sub-directory called /testing123/
and make a .htaccess in it
and put in the .htaccess
RewriteEngine On
then go to
Code:
www.store.litespeedtech.com/testing123/
and it will NOT redirect to the URL without the www.
Last edited by aww; 01-31-2009 at 08:27 PM..
|

02-01-2009, 07:43 PM
|
|
LiteSpeed Staff
|
|
Join Date: May 2003
Location: New Jersey
Posts: 7,603
|
|
|
we will investigate.
|

02-13-2009, 03:15 PM
|
|
Senior Member
|
|
Join Date: May 2007
Posts: 237
|
|
|
Was anything discovered about this?
|
| Thread Tools |
|
|
| Display Modes |
Linear Mode
|
Posting Rules
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is Off
|
|
|
All times are GMT -7. The time now is 08:13 PM.
|
|