Mobile app version of vmapp.org
Login or Join
Kristi941

: XenForo SEO Friendly URL returns 404 on forum page I have my .htaccess file in the base directory of the installation of XenForo. When I enable SEO Friendly URLs, it returns error 404 only

@Kristi941

Posted in: #Apache #Htaccess #Seo #Ubuntu

I have my .htaccess file in the base directory of the installation of XenForo. When I enable SEO Friendly URLs, it returns error 404 only on the forums and members pages.

htaccess file:

# 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 /

# 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>


when looking at the links when SEO Friendly URLs is enabled/disabled the index.php? is gone, which it's supposed to do but it can't seem to find the forums...

10.01% popularity Vote Up Vote Down


Login to follow query

More posts by @Kristi941

1 Comments

Sorted by latest first Latest Oldest Best

 

@Alves908

Apparently not, no error whatsoever.


It seems that .htaccess files are not allowed/enabled on your server, since adding some random text to the file produces no error. (You would expect to see a 500 Internal Server Error otherwise.)

You need to set AllowOverride All (or something more restrictive like AllowOverride FileInfo - enough for mod_rewrite) in your server config (<Directory> container) that covers the document root directory.

However, if you have access to the server config then you can do all of this in the server config and not use .htaccess at all (recommended).

Reference: httpd.apache.org/docs/2.4/mod/core.html#allowoverride


UPDATE: And then if it's still not working, repeat the checks as mentioned in comments above:


Is mod_rewrite enabled? Remove the <IfModule mod_rewrite.c> wrapper - do you get an error? If mod_rewrite is not enabled then expect to see a 500 Internal Server Error (your error log should contain the specific details of the error). You need to enable mod_rewrite and restart Apache.
Is FollowSymLinks (or SymLimksIfOwnerMatch) enabled? This is required for mod_rewrite to work. Add Options +FollowSymLinks at the top of your .htaccess file.


If you are still seeing an Apache generated 404 message then then "something else" is going on, since the URL is not being rewritten. (Your .htaccess file looks "OK".)

If you are seeing a 404 generated from your framework (XenForo) then the problem is with your application.

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme