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

XF 1.4 Trouble with Friendly Urls.

#1
So I've followed everything instructed here in this link provided and I end up with a 404 Error Page
https://xenforo.com/help/friendly-urls/

After searching through the forums, I've also followed other solutions granted to fix this problem.

I've already confirmed the web is under Apache, mod_rewrite is enabled, uncommented RewriteBase and set to the appropriate directory of the forums under the .htaccess file, and set AllowOverride to All under the httpd.conf file. I still end up with the 404 Page.

I'm not quite sure what I'm doing wrong, or whatever it is that is preventing the friendly-urls.
 

Mike

XenForo developer
Staff member
#2
But this in your .htaccess:
Code:
order deny,allow
deny from all
(If you're running Apache 2.4, use "Require all denied" instead.)

Can you still access things? If so, the .htaccess is being ignored and it's almost certainly down to AllowOverride settings.
 
#3
Ahh well we're currently running Apache/2.2.15 (CentOS)

The only thing I can access is the Home Page, every other pages shows 404 Not Found.

Does this seem right?
httpd.conf
Code:
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
DocumentRoot "/var/www/html"

#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory /var/www>
    Options FollowSymLinks
    AllowOverride All
</Directory>

#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#

#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory /var/www/html>

#
# Possible values for the Options directive are "None", "All",
# or any combination of:
#   Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important.  Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
    Options Indexes FollowSymLinks

#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
#   Options FileInfo AuthConfig Limit
#
    AllowOverride All

#
# Controls who can get stuff from this server.
#
    Order allow,deny
    Allow from all

</Directory>
.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 /hub

    #    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>
 
Last edited:

Mike

XenForo developer
Staff member
#4
Did the lines I recommended putting in your .htaccess do anything?
 
Last edited:
#5
I did earlier, but nothing happen, then again idk if I input it correctly.

Edited: I tried it again, rather than putting it under the RewriteEngine line, I placed it at the very top, and it caused a 403 Error Page this time.
 
Last edited:

Mike

XenForo developer
Staff member
#6
The RewriteEngine line doesn't do anything itself, so if you put it in the <IfModule> tag, that may indeed be implying that mod_rewrite isn't available. You could check by removing the <IfModule> elements and seeing if the behavior changes.

Otherwise, your RewriteBase line may be incorrect; it's generally not needed. It should at least have a trailing "/" though.