Report this

What is the reason for this report?

Pretty permalinks going to 404

Posted on June 10, 2017

I’ve been having this issue all day and I can’t figure it out. My site keeps going to a 404 page when it’s accessing the pretty url for a blog post

My htaccess file looks fine to me and so does the vhost conf file but maybe I’m missing something? I’ve restarted apache and also enabled a2enmod rewrite…

http conf

<VirtualHost *:80>
  ServerAdmin webmaster@domain.com
  ServerName domain.com
  ServerAlias www.domain.com

  DocumentRoot /var/www/domain.com
  <Directory />
       Options FollowSymLinks
       AllowOverride None
  </Directory>
  <Directory /var/www/domain.com>
       Options Indexes FollowSymLinks MultiViews
  AllowOverride None
       Order allow,deny
       allow from all
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/domain.com-error.log
  CustomLog ${APACHE_LOG_DIR}/domain.com-access.log combined

RewriteEngine on
RewriteCond %{SERVER_NAME} =domain.com [OR]
RewriteCond %{SERVER_NAME} =www.domain.com
RewriteRule ^ https://%{SERVER_NAME}%{REQUEST_URI} [END,NE,R=permanent]
</VirtualHost>

https conf

<IfModule mod_ssl.c>
<VirtualHost *:443>
  ServerAdmin webmaster@domain.com
  ServerName domain.com
  ServerAlias www.domain.com

  DocumentRoot /var/www/domain.com
  <Directory />
       Options FollowSymLinks
       AllowOverride None
  </Directory>
  <Directory /var/www/domain.com>
       Options Indexes FollowSymLinks MultiViews
  AllowOverride None
       Order allow,deny
       allow from all
  </Directory>
  ErrorLog ${APACHE_LOG_DIR}/domain.com-error.log
  CustomLog ${APACHE_LOG_DIR}/domain.com-access.log combined

SSLCertificateFile /etc/letsencrypt/live/domain.com/fullchain.pem
SSLCertificateKeyFile /etc/letsencrypt/live/domain.com/privkey.pem
Include /etc/letsencrypt/options-ssl-apache.conf
</VirtualHost>
</IfModule>

.htaccess

RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]

# add a trailing slash to /wp-admin
RewriteRule ^wp-admin$ wp-admin/ [R=301,L]

RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^ - [L]
RewriteRule ^(wp-(content|admin|includes).*) $1 [L]
RewriteRule ^(.*\.php)$ $1 [L]
RewriteRule . index.php [L]

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Start building today

From GPU-powered inference and Kubernetes to managed databases and storage, get everything you need to build, scale, and deploy intelligent applications.