mod rewrite not working correctly after switch

Discussion in 'Install/Configuration' started by bangsters, Jan 18, 2012.

  1. bangsters

    bangsters Member

    Hi.

    Mostly our litespeed upgrade has been working. We have switched our servers to production version of litespeed.

    Only problem, for some clients is mod rewrite.

    If you go to one of our clients site, like

    http://blog.tailoredvps.com/announcements/we-have-got-new-nodes-and-vps-plans/

    you will notice that the page layout is no longer displaying correctly.

    I believe it has something to do with mod rewrite or the .htaccess file. However, other sites with rewrite on is working fine, so I'm a bit puzzled. Below is the .htaccess file contents:

    AddType application/x-httpd-php .php .htm .html .php5

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

    The above was working fine with apache.
  2. NiteWave

    NiteWave Administrator

    strange issue. please try following:
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_URI} !\.css$
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    see what happens.
  3. bangsters

    bangsters Member

    still the same result.
  4. NiteWave

    NiteWave Administrator

    please try to remove:
    AddType application/x-httpd-php .php .htm .html .php5

    and see if it back to normal.

    use following rewriterule should fix the issue, but just an workaround.
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule (.*\.css) http://tailoredvps.com/$1 [R,L]

    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
  5. bangsters

    bangsters Member

    Thanks. That fixed the layout, but it's still not going to blog.tailoredvps.com. Instead it still shows the main page of tailoredvps and not the blog.

    Any suggestions?
  6. webizen

    webizen New Member

    pls enable rewrite logging (add "RewriteLogLevel 9" in httpd.conf) to troubleshoot.
  7. NiteWave

    NiteWave Administrator

    I see the site is ok at present.

    so when enable friendly URL in wp, there is issue.
    when disable, it's normal.
  8. bangsters

    bangsters Member

    yeah looks like mod rewrite for wordpress isn't working properly. Our other sites using mod rewrite though are fine (zencart sites)... but the wordpress ones are not loading properly....
  9. webizen

    webizen New Member

    pls enable rewrite logging to troubleshoot the rewrite rules issue.

    for apache vhost, add line "Rewrite Loglevel 9" in httpd.conf

    for LSWS native vhost, enable rewrite logging via Admin CP (Configuration => Virtual Hosts => vhost => Rewrite => Enable Rewrite: Yes, Log Level: 9)

    rewrite entry should have "[REWRITE]" tag (in error.log or error_log)

Share This Page