XF 1.4 Friendly URLs Not Working

foncused

Member
Hi,

I am having problems getting my friendly urls to work. I have installed XenForo in /home/website/www and my .htaccess file is present in that directory.

.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 500 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 /home/website/www

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

I have set AllowOverride to 'All' in Apache (/etc/apache2/sites-available/default):

<VirtualHost *:80>
ServerAdmin webmaster@localhost

DocumentRoot /home/website/www
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
<Directory /home/website/www>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
allow from all
</Directory>

ScriptAlias /cgi-bin/ /usr/lib/cgi-bin/
<Directory "/usr/lib/cgi-bin">
AllowOverride All
Options +ExecCGI -MultiViews +SymLinksIfOwnerMatch
Order allow,deny
Allow from all
</Directory>

ErrorLog ${APACHE_LOG_DIR}/error.log

# Possible values include: debug, info, notice, warn, error, crit,
# alert, emerg.
LogLevel warn

CustomLog ${APACHE_LOG_DIR}/access.log combined

Alias /doc/ "/usr/share/doc/"
<Directory "/usr/share/doc/">
Options Indexes MultiViews FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
Allow from 127.0.0.0/255.0.0.0 ::1/128
</Directory>

</VirtualHost>

I also ran this in my shell window to enable mod_rewrite:

sudo a2enmod rewrite && sudo service apache2 restart

After these changes are applied, I can visit my home page correctly: foncused.net
Going to a different tab, like 'forums' however shows up as an error page.

I would really appreciate any help with this, it is my first time configuring Apache and setting up a website.
 
Just so you know.. it was probably your rewriteBase you had defined in your .htaccess. Your root was already where your RewriteBase was also pointed at, so if I understand correctly what it was basically looking for was it as /home/website/www off of your root that was defined in the vhost.
 
Back
Top Bottom