Rewrite Rules Problem

Discussion in 'General' started by LinuxFreak, Jun 27, 2008.

  1. LinuxFreak

    LinuxFreak New Member

    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.
  2. mistwang

    mistwang LiteSpeed Staff

    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/
  3. LinuxFreak

    LinuxFreak New Member

    Re:

    Dear mistwang,

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

    Best Regards.
  4. mistwang

    mistwang LiteSpeed Staff

    Post the URL have problem with and the corresponding error log section containing rewrite log.
  5. LinuxFreak

    LinuxFreak New Member

    Re:

    Dear mistwang,

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

    Best Regards.
  6. mistwang

    mistwang LiteSpeed Staff

    It is not possible, but you can grep your IP to extract related the log entries.
  7. LinuxFreak

    LinuxFreak New Member

  8. mistwang

    mistwang LiteSpeed Staff

    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.
  9. LinuxFreak

    LinuxFreak New Member

    Re:

    Dear mistwang,

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

    Best Regards.
  10. mistwang

    mistwang LiteSpeed Staff

    Post the rewrite log then.
  11. LinuxFreak

    LinuxFreak New Member

    Re:

    Dear mistwang,

    It has been fixed.

    Can you tell me how can we disable mod_security ?

    Best Regards.
  12. ffeingol

    ffeingol Member

    Change:

    SecFilterEngine On

    to

    SecFilterEngine Off
  13. LinuxFreak

    LinuxFreak New Member

    Re:

    Dear ffeingol,

    In rewrite section of virtual host ?

    Best Regards.
  14. mistwang

    mistwang LiteSpeed Staff

    With LSWS native configuration, you just disable "Request Filter" for that vhost.
  15. LinuxFreak

    LinuxFreak New Member

    Re:

    Dear mistwang,

    Thanks.

    Best Regards.

Share This Page