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

XF 1.5 Friendly Urls

Discussion in 'Troubleshooting and Problems' started by CDog, Sep 7, 2015.

  1. CDog

    CDog New Member

    Hi,
    I've installed xenforo in a subdomain
    testforum.mysite.com

    The folder of the install is
    testforum.mysite.com/maForum

    Changed the htaccess.txt to .htaccess
    changed the
    #RewriteBase /xenforo
    RewriteBase /maForum

    the friendly urls work with www.mysite.com/maForum
    but not testforum.mysite.com. (get 500 server error, and server logs empty)

    My host is godaddy and modrewrite with allow (according to their docs) is enabled.

    Does this mean i have to make more changes in the htaccess file, if so could someone advise what I need to do to get friendly urls to work with the subdomain.

    Thanks a lot
    c
     
  2. Brogan

    Brogan XenForo Moderator Staff Member

    Are Friendly URLs actually working?
    To be clear, that relates to the index.php in the URL, not the www at the beginning.

    To force your site to use www or not, see point 19 of the FAQ: Frequently Asked Questions
     
  3. CDog

    CDog New Member

    I think so, there is no index.php?
    the url looks something like this
    www.mysite.com/maForum/forums/news.44

    I'll have a look at point 19 again, i was too unsure of how to do it to try it. Ive not done any mod rewrites before.
     
  4. CDog

    CDog New Member

    Should I add these or use them to replace the conditions in the standard .htaccess file.
    - whats standard in the .htaccess
    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]

    ----
    - from point 19
    RewriteCond %{HTTP_HOST} ^example.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
    Code:
    RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
    Code:
    RewriteCond %{HTTP_HOST} !^www.example\.com$ [NC]
    RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L,QSA]
     
  5. Brogan

    Brogan XenForo Moderator Staff Member

    You need to add the additional rules.

    Don't remove any of the default lines.
     
  6. CDog

    CDog New Member

    sorry draggin my feet here because i dont fully understand. I have some regex experience but only on a sort of need to know basis.

    I tried this after the default .htaccess conditions.
    I get an internal server error for the subdomain and www.mysite.com/maForum/forums/etc still works
    When that didnt work I put it before the default conditions and that generates an loop error.
    I cleared browser history and tried both again but still get the same errors,
    any other advice?

    RewriteCond %{HTTP_HOST} ^mysite.com$ [NC]
    RewriteRule ^(.*)$ http://testforum.mysite.com/$1 [R=301,L]
    #Code:
    RewriteCond %{HTTP_HOST} ^mysite\.com$ [NC]
    RewriteRule ^(.*)$ http://testforum.mysite.com/$1 [R=301,L]
    #Code:
    RewriteCond %{HTTP_HOST} !^www.mysite\.com$ [NC]
    RewriteRule ^(.*)$ http://testforum.mysite.com/$1 [R=301,L,QSA]
     
    Last edited: Sep 8, 2015
  7. Brogan

    Brogan XenForo Moderator Staff Member

    Are you adding all of those rules?

    You only need to add one.

    Various examples are provided in the FAQ as servers are different and what works on one server may not work on another.

     
  8. CDog

    CDog New Member

    Yes I added all, i'll try one at a time.
     
  9. CDog

    CDog New Member

    ok, one at a time, I still get the internal server error. :cry:
    I tried them with 'rewrite base' commented and uncommented.
    I cleard browser data regularly.
    I checked my subdomain is a standard godaddy subdomain 'installation' if you can call it an installation. You create a directory and then do whatever they ask you to do in what they call the Ahost file. Its set up like my other subdomains.
    Any other advice?
    Thank you
    C
     
  10. Brogan

    Brogan XenForo Moderator Staff Member

    You would need to check the serve error log to see what's throwing the error.

    You could also try contacting your host for support.
    Perhaps they have dealt with rewrites of this nature before and are aware of what needs to be done to get them working.
     

Share This Page