• 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

batpool52!

Well-known member
#4
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
 

wickedstangs

Well-known member
#5
@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.
 

wickedstangs

Well-known member
#9
You do realise to estivate it you rename to .htaccess instead of htaccess.txt?
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>
 

Mr Lucky

Well-known member
#11
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.
 

Mike

XenForo developer
Staff member
#14
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?
 

Mike

XenForo developer
Staff member
#17
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.)
 

wickedstangs

Well-known member
#19
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.)
From my hosting...
AllowOverride is enabled. It will always be enabled on a cPanel server unless you've taken steps to disable it. Only two exceptions exist on your server, for the following directories:
--
/usr/local/apache/htdocs
/usr/local/apache/cgi-bin
--
 

Mike

XenForo developer
Staff member
#20
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?