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

XF 1.3 Friendly URLs not working

Discussion in 'Troubleshooting and Problems' started by Silverbrit, Jul 2, 2014.

  1. Silverbrit

    Silverbrit Member

    Hello,

    I just reinstalled xenforo on a new server after using a mysql dump and everything, it all works when I go to my homepage. However, Friendly URLS are not working anymore. The homepage www.example.com works but when I try to go to another tab (ex. /forums) it comes up with this error:

    Not Found
    The requested URL /forums/ was not found on this server.

    Apache/2.2.22 (Debian) Server at www.example.com Port 80

    I had someone before install litespeed onto my old server, but I'm just using apache now. I think that is where the problem lays.

    Thanks
     
  2. Liam W

    Liam W Well-Known Member

    Try replacing the .htaccess file with the contents of the htaccess.txt file in the XenForo package.

    Liam
     
  3. Silverbrit

    Silverbrit Member

    I have done that already and the problem still persists.

    This is what the .htaccess file looks like:
    Code:
    #    Mod_security can interfere with uploading of content such as attachments. If you
    #    cannot attach files, remove the "#" from the lines below.
    #<IfModule mod_security.c>
    #    SecFilterEngine Off
    #    SecFilterScanPOST Off
    #</IfModule>
    
    ErrorDocument 401 default
    ErrorDocument 403 default
    ErrorDocument 404 default
    ErrorDocument 500 default
    
    <IfModule mod_rewrite.c>
        RewriteEngine On
    
        #    If you are having problems with the rewrite rules, remove the "#" from the
        #    line that begins "RewriteBase" below. You will also have to change the path
        #    of the rewrite to reflect the path to your XenForo installation.
        #RewriteBase /xenforo
    
        #    This line may be needed to enable WebDAV editing with PHP as a CGI.
        #RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    
        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]
    </IfModule>
     
  4. AndyB

    AndyB Well-Known Member

    You need to remove the '#' from the following:

    #RewriteBase /xenforo

    It will need to be like this assuming you're running XenForo from the forum root:

    RewriteBase /
     
  5. Silverbrit

    Silverbrit Member

    Still not working, I think I have the path is different. My xenforo files are all located at:
    /home/user/public/example.com/public

    Would I set the RewriteBase to that?

    EDIT: That did not seem to work :(
     
    Last edited: Jul 2, 2014
  6. AndyB

    AndyB Well-Known Member

    Try this:

    RewriteBase /public
     
    Silverbrit likes this.
  7. Silverbrit

    Silverbrit Member

    Awesome! Everything is working now.

    Thank you AndyB
     
  8. Silverbrit

    Silverbrit Member

    I guess I spoke too soon, it seemed to have worked for about 5 minutes, with the correct url (ex. www.example.com/forums) but it seems to be giving me the 404 message again?

    @AndyB
     
  9. Tracy Perry

    Tracy Perry Well-Known Member

    If this is Silverbrit from our Skype convo.. it is a setting in your apache httpd.conf in which you need to change the allow override setting (most likely).
    Once I finish this other VPS install I'm doing for a guy I can help a little more but I've had 2 to do and a server to work on at a local client so time has been cramped.
     
  10. Tracy Perry

    Tracy Perry Well-Known Member

    This issue is resolved... it was the rewritebase directive.
     
    Brandon Sheley and AndyB like this.

Share This Page