PDA

View Full Version : Rewrite Rules Problem


LinuxFreak
06-26-2008, 10:39 PM
Dear Support,
Hello,

I have downloaded LiteSpeed Trial to test it with vBulletin Forum. I have found that my rewrite rules are not working with LiteSpeed for some reason.

Following are the rewrite rules which are being used by our apache server.

#Show Thread Main Rules
RewriteRule ^(.*/)?(t-)([A-Za-z0-9\-]+)?-([0-9]+)/page([0-9]+)(/.*)?$ showthread.php?t=$4&page=$5&is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^(.*/)?(t-)([A-Za-z0-9\-]+)?-([0-9]+)(/.*)?$ showthread.php?t=$4&is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^(.*/)?(t-)([A-Za-z0-9\-]+)?-([0-9]+)-new$ showthread.php?t=$4&goto=newpost&%{QUERY_STRING} [L]
RewriteRule ^(.*/)?(t-)([A-Za-z0-9\-]+)?-([0-9]+)-last$ showthread.php?t=$4&goto=lastpost&%{QUERY_STRING} [L]
RewriteRule ^(.*/)?(t-)([A-Za-z0-9\-]+)?-([0-9]+)-post([0-9]+)(/.*)?$ showthread.php?p=$5&%{QUERY_STRING} [L]
RewriteRule ^(.*/)?(t-)([A-Za-z0-9\-]+)?-([0-9]+)-print(/.*)?$ printthread.php?t=$4&is_vrewrite=yes&%{QUERY_STRING} [L]

#Forumdisplay Rules
RewriteRule ^f-([A-Za-z0-9\-]+)?-([0-9]+)/page([0-9]+)(/.*)?$ forumdisplay.php?f=$2&&page=$3%{QUERY_STRING}&is_vrewrite=yes [L]
RewriteRule ^f-([A-Za-z0-9\-]+)?-([0-9]+)(/.*)?$ forumdisplay.php?f=$2&%{QUERY_STRING}&is_vrewrite=yes [L]

#Showpost Rules
RewriteRule ^p-([A-Za-z0-9\-]+)?-post([0-9]+)/postcount([0-9]+)$ showpost.php?p=$2&postcount=$3&is_vrewrite=yes&%{QUERY_STRING} [L]

#Memberinfo Rules
#RewriteRule ^u-([A-Za-z0-9\-]+)?-([0-9]+)$ member.php?u=$2&is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^members/([A-Za-z0-9\-]+)?-([0-9]+)(/.*)?$ member.php?u=$2&is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^members/([A-Za-z0-9\-]+)(/.*)?$ member.php?username=$1&is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^(.*)/(member\.php)$ member.php?$1&%{QUERY_STRING} [L]

#vbseo site map rule
RewriteRule ^((urllist|sitemap).*\.(xml|txt)(\.gz)?)$ vbseo_sitemap/vbseo_getsitemap.php?sitemap=$1 [L]

RewriteRule ^(.*)/(styleid=(.*))$ showthread.php?&%{QUERY_STRING} [L]
RewriteRule ^(.*)/(showthread\.php)$ showthread.php?&%{QUERY_STRING} [L]

RewriteRule ^onlineusers(/)?$ online.php?is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^showgroups(/)?$ showgroups.php?is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^memberslist(/)?$ memberlist.php?is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^members(/)?$ memberlist.php?is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^boardrules(/)?$ faq.php?faq=boardrules&&is_vrewrite=yes&%{QUERY_STRING} [L]
RewriteRule ^disclaimer(/)?$ faq.php?faq=fstdisclaimer&&is_vrewrite=yes&%{QUERY_STRING} [L]

RewriteRule ^search-([A-Za-z0-9\-]+)/$ search.php?do=$1 [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/(.*)(\.php)$ $2.php?&%{QUERY_STRING} [L]

RewriteRule ^verifieds/emule.gif$ images/smilies/emule.gif
RewriteRule ^verifieds/ft.gif$ images/smilies/ft.gif

Best Regards.

mistwang
06-27-2008, 11:06 AM
You should enable rewrite log with "RewriteLogLevel 9" in the vhost configuration section for that website. then check /opt/lsws/logs/error.log or error_log under /usr/local/apache/logs/

LinuxFreak
06-27-2008, 11:12 AM
Dear mistwang,

I have done this already but i did not get much information.

Best Regards.

mistwang
06-27-2008, 11:39 AM
Post the URL have problem with and the corresponding error log section containing rewrite log.

LinuxFreak
06-27-2008, 11:42 AM
Dear mistwang,

I will do that can you tell me is there any way to keep rewrite logs separate ?

Best Regards.

mistwang
06-27-2008, 12:44 PM
It is not possible, but you can grep your IP to extract related the log entries.

LinuxFreak
06-27-2008, 08:28 PM
Dear mistwang,

Following is the log output.

FYI, http://rafb.net/p/Hd8NuS78.html

Best Regards.

mistwang
06-27-2008, 09:01 PM
You are using rewrite rules for .htaccess at vhost level, it will not work. You have to use .htacces or create a static context "/" and move rewrite rule there.
rewrite rule at vhost level does not have a rewrite base to remove from URL.

LinuxFreak
06-27-2008, 10:43 PM
Dear mistwang,

I have also used rewrite rules in .htaccess but they are not working :(

Best Regards.

mistwang
06-28-2008, 04:18 AM
Post the rewrite log then.

LinuxFreak
06-28-2008, 08:39 AM
Dear mistwang,

It has been fixed.

Can you tell me how can we disable mod_security ?

Best Regards.

ffeingol
06-28-2008, 12:20 PM
Change:

SecFilterEngine On

to

SecFilterEngine Off

LinuxFreak
06-28-2008, 12:43 PM
Dear ffeingol,

In rewrite section of virtual host ?

Best Regards.

mistwang
06-28-2008, 03:16 PM
With LSWS native configuration, you just disable "Request Filter" for that vhost.

LinuxFreak
06-29-2008, 02:35 AM
Dear mistwang,

Thanks.

Best Regards.