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

Pretty URLs Not Working

Discussion in 'Troubleshooting and Problems' started by Ian Eberle, Dec 19, 2012.

  1. Ian Eberle

    Ian Eberle Member

    I have my forum installed inside a WordPress install and it's working perfectly except for the SEO-friendly URLs, pretty URLs or whatever they're called. Whenever I turn them on, it loads on the WordPress site and gives me 404 errors. When I turn them off and leave it /index.php?... it works fine.

    WordPress: www.aquaticforums.net
    Xenforo: www.aquaticforums.net/forums

    Is this a downside of using both WordPress and Xenforo in the same parent folder on my server?
     
  2. MattW

    MattW Well-Known Member

    What have you got in your .htaccess file? Is it using the Wordpress version, or the Xenforo version?
     
    Jake Bunce likes this.
  3. Ian Eberle

    Ian Eberle Member

    It should be using the XenForo .htaccess. There's a .htaccess in the folder WordPress is in and there's another one in /forums too. They're on different databases too.

    I'm not sure what I have in my .htaccess file as I've never looked at one in my life. I just know that it's there.
     
  4. MattW

    MattW Well-Known Member

    So your Xenforo install is inside a folder called /forums, and the WordPress install is in the root directory of the domain?

    Is mod_rewrite enabled?
     
    Jake Bunce likes this.
  5. Ian Eberle

    Ian Eberle Member

    That's correct.

    How would I know if mod_rewrite is enabled?
     
  6. MattW

    MattW Well-Known Member

    If you log into your ACP on the forum, go to URL: admin.php?tools/phpinfo

    In there, search for mod_rewrite to see if it's there in the loaded modules area.
     
    Jake Bunce likes this.
  7. Ian Eberle

    Ian Eberle Member

    I looked and I don't think it's there, but I'm not sure. So I saved the PHP info as a PDF so you can take a second look. Thanks for your help!

    PDF is attached below:
     

    Attached Files:

  8. MattW

    MattW Well-Known Member

    Ah, good old Hostgator!

    Firstly, you are on a very old version of PHP. 5.2 was End Of Life in 2010! : http://uk.php.net/archive/2010.php

    I can't see mod_rewrite anywhere in that file. Is this shared hosting you are on?
     
    Jake Bunce likes this.
  9. Ian Eberle

    Ian Eberle Member

    Yes, it's HostGator shared hosting. Once my forum outgrows it, though, I'll be moving to VPS :)
     
  10. Ian Eberle

    Ian Eberle Member

    Is it HostGator's fault I have an old version of PHP or mine?
     
  11. MattW

    MattW Well-Known Member

    Their fault. They seem to like to run the old 5.2 version of PHP.

    Contact them and ask them to enable mod_rewrite and the SEO URL's should work.
     
    Jake Bunce likes this.
  12. Ian Eberle

    Ian Eberle Member

  13. MattW

    MattW Well-Known Member

    So they have said it's active on the server? In that case, can you post the contents of the .htaccess file in the forum directory?
     
    Jake Bunce likes this.
  14. Ian Eberle

    Ian Eberle Member

    #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>
     
  15. MattW

    MattW Well-Known Member

    That's the standard .htaccess file, and should work.
     
    Jake Bunce likes this.
  16. Ian Eberle

    Ian Eberle Member

    Let me try enabling pretty URLs and see what happens.
     
  17. Ian Eberle

    Ian Eberle Member

    When I click on anything on the forum, I get a 404 error. The 404 error page is part of my WordPress site not my XenForo site. Try it out:

    http://www.aquaticforums.net/forums/
     
  18. MattW

    MattW Well-Known Member

    It's working now for me? Have you done something else to fix it?
     
    Jake Bunce likes this.
  19. Ian Eberle

    Ian Eberle Member

    I should have paid more attention... It works now. Thanks for your help!
     
    Jake Bunce and MattW like this.
  20. MattW

    MattW Well-Known Member

    Excellent, glad it's sorted (y)
     

Share This Page