1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

XF 1.1 Rewrite Rules Problem

Discussion in 'Troubleshooting and Problems' started by AWS, Nov 26, 2011.

  1. AWS

    AWS Well-Known Member

    I am on a Windows 2008 r2 server with Helicontech isapi rewrite 3 installed.

    I added the rewrite rules to my .htaccess file in the forum root. Turned on friendly urls in admin and started to browse the site. The urls do work, however, all styling is gone. I have been editing the rules for 2 days and I either get the style working with 404's all over or no style and working url's.

    Here is the contents of my .htaccess file:
    Code:
    # Helicon ISAPI_Rewrite configuration file
    # Version 3.1.0.79
     
    RewriteEngine On
     
    RewriteBase /
     
    RewriteRule ^/index\.php$ http\://justbs\.us/ [NC,R=301]
    RewriteCond %{HTTP:Host} ^www\.justbs\.us$
    RewriteRule (.*) http\://justbs\.us$1 [NC,R=301]
     
    RewriteCond %{REQUEST_FILENAME} -f [OR]
    RewriteCond %{REQUEST_FILENAME} -l [OR]
    RewriteCond %{REQUEST_FILENAME} -d
    RewriteRule ^.*$ - [NC,L]
    RewriteRule ^(data/|js/|styles/|install/|favicon\.ico|crossdomain\.xml|robots\.txt) - [NC,L]
    RewriteRule ^.*$ index.php [NC,L]
     
    # Redirects for old IPB URL's
     
    RewriteCond %{REQUEST_URI} /(topic|forum|user)/ [OR]
    RewriteCond %{QUERY_STRING} (^|&)show(topic|forum|user)= [OR]
    RewriteCond %{QUERY_STRING} ^/(topic|forum|user)/ [OR]
    RewriteCond %{PATH_INFO} ^/(topic|forum|user)/
    RewriteRule ^.*$ ips2xf.php [NC,L]
    
    Any ideas on what could be wrong?
     
  2. Mike

    Mike XenForo Developer Staff Member

    Try changing this:
    Code:
    RewriteCond %{REQUEST_URI} /(topic|forum|user)/ [OR]
    to:
    Code:
    RewriteCond %{REQUEST_URI} ^/(topic|forum|user)/ [OR]
    It applies if your forum is in the root (or your use the rewrite base).
     
  3. AWS

    AWS Well-Known Member

    Disregard this. Turns out one simple change was all that was needed. Sometimes posting about a problem brings a clear perspective and you can see the easy fix.

    For those that run IIS with isapi rewrite 3 this line needs to be changed and it's a very simple fix.

    Code:
    RewriteRule ^.*$ index.php [NC,L]
    to this

    Code:
    RewriteRule /.*$ index.php [NC,L]
    Just replace the ^ with a forward slash and all works as expected.
     

Share This Page