XF 2.2 Enabled SSL - All links across the website going to 404, Login functionality is not working but the home page is rendered fine

Hi,

We just set an SSL certificate on our test site to ensure that SSL/HTTPS works. We're now getting a 404 error on all pages except home page.
We have not done any changes in the .htaccess after enabling the SSL.

Appreciate any help!
 
What do you have in your .htaccess file?
Hello, Below is the snippet of the .htaccess. Also, we have set up the SSL on port 443.

# 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

#########################
# redirect www to no-www
#########################
#RewriteCond %{HTTPS} off
#RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]
#RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
RewriteRule ^(.*) http://%1/$1 [R=301,NE,L]
#RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [NE,L,R]
#RewriteCond %{SERVER_PORT} ^80$
#RewriteRule ^(.*)$ https://%{SERVER_NAME}%{REQUEST_URI} [L,R]
RewriteBase /

# 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>
 
All pages on your site work fine for me over https.
Hi Brogan,

Our live site works on HTTPS. However, we are making changes to the testing environment which is in HTTP. After we enabled SSL, all the links are going 404. Although, if we change the page URL to HTTP, it works.

Are there any changes you would suggest?
 
Hard to say - it's not something I've really heard of before.

Does it work if you enable SSL and disable Friendly URLs?

Try restoring the original .htaccess file supplied with XF - you can rename the htaccess.txt file to do that.
 
Hard to say - it's not something I've really heard of before.

Does it work if you enable SSL and disable Friendly URLs?

Try restoring the original .htaccess file
Brogan,
Thanks for your help. Disabling Friendly URLs was helpful. However, we realized that we missed adding the following lines in the virtualHost block during the SSL setup, and then it worked.

<Directory /var/www/html>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
 
Last edited:
Top Bottom