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

XF 1.5 appropriate .htaccess for Full Friendly URLs

Discussion in 'XenForo Questions and Support' started by wickedstangs, Jul 29, 2015.

  1. wickedstangs

    wickedstangs Well-Known Member

    Can someone post What is the appropriate .htaccess for Full Friendly URLs.
     
  2. batpool52!

    batpool52! Well-Known Member

    htaccess.txt file that comes with xenforo installation / upgrade package
     
  3. wickedstangs

    wickedstangs Well-Known Member

    I know what htaccess.txt file is what in there do I have to do for Full Friendly URLs?
     
  4. batpool52!

    batpool52! Well-Known Member

    There is nothing to do in htaccess file after that unless you're facing any issues with the friendly urls. Have you enabled "Use Full Friendly URLs" in ACP > Options > Search Engine Optimization (SEO)

    upload_2015-7-29_17-37-13.png
     
  5. wickedstangs

    wickedstangs Well-Known Member

    @batpool52! I get this
    Not Found
    The requested URL /community/forums/ was not found on this server.

    Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
     
  6. Martok

    Martok Well-Known Member

    Which forum is this for? Your wickedstangs one is working fine for me and full friendly URLs are enabled.
     
  7. wickedstangs

    wickedstangs Well-Known Member

  8. Mr Lucky

    Mr Lucky Well-Known Member

    You do realise to estivate it you rename to .htaccess instead of htaccess.txt?
     
    wickedstangs and batpool52! like this.
  9. wickedstangs

    wickedstangs Well-Known Member

    ok so when I upload the file htaccess.txt need to rename it to .htaccess ?

    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 405 default
    ErrorDocument 406 default
    ErrorDocument 500 default
    ErrorDocument 501 default
    ErrorDocument 503 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>
     
  10. batpool52!

    batpool52! Well-Known Member

    Yes.
     
    wickedstangs likes this.
  11. Mr Lucky

    Mr Lucky Well-Known Member

    It is Not active until renamed

    Note that if you rename it on your desktop it becomes a hidden file, though normally viewable on an FTP software.

    Once you have the fit in front and no extension then it will be active and should work.
     
    wickedstangs likes this.
  12. Mr Lucky

    Mr Lucky Well-Known Member

    Funny how we can miss the obvious. Or not realise they are only obvious once we know the ropes.

    I often think the instruction manuals sometimes forget people start from knowing nothing
     
    creativeforge likes this.
  13. wickedstangs

    wickedstangs Well-Known Member

    Crazy, I have a couple of licenses and never had to do that..:(
    lic.JPG
     
  14. Mike

    Mike XenForo Developer Staff Member

    The .htaccess file is included. htaccess.txt is a copy and a reference of the original version. Normal situations don't need to do any renaming.

    I'm guessing that your server doesn't have AllowOverride on. Is this a shared server or a VPS/dedicated? Have you set up Apache yourself?
     
    Divvens likes this.
  15. wickedstangs

    wickedstangs Well-Known Member

    Its a Managed VPS from KnownHost.com - Your high quality managed VPS hosting provider
     
  16. Brogan

    Brogan XenForo Moderator Staff Member

    As Mike said, either the server isn't configured or you have deleted the .htaccess file at some point.
     
    wickedstangs likes this.
  17. Mike

    Mike XenForo Developer Staff Member

    You may need to look at your Apache configuration then, specifically AllowOverride. Out of the box, it's off so .htaccess files are ignored. (Alternatively you could need to set the RewriteBase in .htaccess, but this is very rare.)
     
    Divvens and wickedstangs like this.
  18. wickedstangs

    wickedstangs Well-Known Member

    checking it now.. Its a new forum just made it this week.. I just contacted my hosting to find out about the AllowOverride...
     
  19. wickedstangs

    wickedstangs Well-Known Member

    From my hosting...
     
  20. Mike

    Mike XenForo Developer Staff Member

    Are you sure the .htaccess file is in place? If you type some random stuff at the top of it, does it then lead to the server triggering an internal server error page?
     
    Divvens likes this.

Share This Page