WordPress permalinks not working but main page is OK
Hi there,
I would be very grateful if someone could help me here.
I am running my website in a Linode. I am using Apache, VirtualHosts and everything should be fine.
But, my WordPress site loads the main page, but not the permalinks (the posts). No pages are being loaded, also.
All of that returns a "Not Found" error. Can this be due to some .htaccess issue? But, if so, how could I start, please?
Thanks in advance.
3 Replies
Hi again,
So, guys, I ended solving the issue here.
What really changed things was this:
On /etc/apache2/apache2.conf
I changed:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
To:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
I also certified that my /etc/apache2/sites-available/mysite.com.conf
has the following:
<Directory /var/www/your_site_path/>
AllowOverride All
</Directory>
Well, now my mysite.com.conf has the below lines, and I am wondering if everything is correct:
<Location /server-status>
SetHandler server-status
Order Deny,Allow
Deny from all
Allow from localhost
</Location>
RewriteEngine on
RewriteCond %{SERVER_NAME} =www.mywebsite.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
<Directory /var/www/html/mywebsite.com/public_html/>
Require all granted
AllowOverride All
</Directory>
Do you guys know if is the above correct, please?
It's been a while since I've dealt with Apache configuration files, but it seems correct. The AllowOverride directive is what you'll need to allow .htaccess files to work.
Glad to hear you solved your issue.
Blake