LiteSpeed Technologies
Download Download     Blog Blog     Wiki Wiki     Forum Forum     Store     Contact Contact    

Go Back   LiteSpeed Support Forums > LiteSpeed Web Server > Install/Configuration > RewriteBase support?

Reply
 
Thread Tools Display Modes
  #1  
Old 10-05-2005, 07:02 AM
jburks725 jburks725 is offline
New Member
 
Join Date: Oct 2005
Posts: 6
Default RewriteBase support?

I'm working with 2.1.2 (Std) and am setting up WordPress (www.wordpress.org). I'd like to use clean URLs, and WP will auto-generate the Apache rewrite rules to support this. After forcing WP to think I'm using Apache, I can get it to write out to a .htaccess file and would like to copy the rules into the VH settings panel rather than leaving them in .htaccess (I've seen this suggested in several threads).

I've run into a small snag. LSWS doesn't seem to support the RewriteBase directive and this causes the the RewriteRules to fail unless I modify them manually to include the base in the matching pattern. For example, here is (part of) what WP wrote to my .htaccess:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
...RewriteRule ^archives/([0-9]{4})/([^/]+).html/(feed|rdf|rss|rss2|atom)/?$ /index.php?year=$1&name=$2&feed=$3 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([^/]+).html/page/?([0-9]{1,})/?$ /index.php?year=$1&name=$2&paged=$3 [QSA,L]
RewriteRule ^archives/([0-9]{4})/([^/]+).html(/[0-9]+)?/?$ /index.php?year=$1&name=$2&page=$3 [QSA,L]
</IfModule>

Copying these rules into the VH configuration (leaving out the first several lines, up to the first RewriteCond) does not work. I get 404 errors for my Permalinks and the debug log shows that no patterns were matched. I noticed in the logs that the URLs passed into the pattern matcher all started with a /, so I modified one of the above rules to the following:

RewriteRule ^/archives/([0-9]{4})/([^/]+).html/page/?([0-9]{1,})/?$ /index.php?year=$1&name=$2&paged=$3 [QSA,L]

Notice the leading slash at the beginning of the regex (^/arc... instead of ^arc...). This works--the pattern matches and the URL is rewritten correctly.

Given this information, and the fact that trying to put the "RewriteBase /" directive in the VH config seems to disable rewriting altogether, I'm left with the following options:

1) Leave the rewrite rules in .htaccess
2) Manually edit all of the RewriteRule lines to start the regex with /

Neither of these is particularly appealing as I'd like to "do the LSWS thing" and put the rewrite rules where they belong, in the VH configuration.

Please advise how I should proceed. Am I missing something where RewriteBase is supported? If RewriteBase is not supported, do you plan to add it?

Thanks,
Jason

P.S. - I love the server. So much nicer to work with than Apache and lighttpd. Still working on getting everything running, but so far everything looks great. Keep up the good work!
Reply With Quote
  #2  
Old 10-05-2005, 10:45 AM
mistwang mistwang is offline
LiteSpeed Staff
 
Join Date: May 2003
Location: New Jersey
Posts: 6,640
Hi Jason,

Thank you for trying our product.

RewriteBase is only effective for per-directory rewrites, and ignored by vhost level rewrites.

There is one work around, instead of adding those rewrite rules to vhost level, you can create a static context with URI set to "/" and path to the document root, then add those rewrite rules under that context, RewriteBase should work then. Actually, it is not necessary for LSWS in most case. :-)

George Wang
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Subversion support? Martha Biggly Install/Configuration 8 04-18-2007 02:28 PM
Installing Oracle support for litespeed reshu1596 PHP 1 02-14-2007 06:53 AM
max_execution_time did not changed piper Install/Configuration 12 01-24-2007 11:27 AM
Litespeed STD could support ssl? wpl12 Install/Configuration 1 11-06-2006 11:13 PM
Premature end of response header alex Bug Reports 10 06-11-2006 07:48 AM


All times are GMT -7. The time now is 11:50 AM.



- Archive - Top
© Copyright 2003-2007 LiteSpeed Technologies, Inc. All rights reserved. Privacy Policy.