I apologize for the seemingly duplicate issue posting but I can't seem to find someone who has come across my specific issue and resolved it. This post got close but I did everything they did.
here's where I'm at:
- migrated a wp site to an AWS server running ubuntu 18
- rewrite mod is enabled
- site is in
/home/ubuntu/sites/my-wp-site
- site dir is owned by www-data
- site's virtual hosts file has the necessary
"Directory"
section with"AllowOverride All"
set - site's .htaccess file has the rewrite rules set by the permalinks settings in the UI
- apache2 config also has the
"AllowOverride All"
set for a"Directory"
section pointed at/home/ubuntu/sites
What am I missing?
.htaccess
contents after setting the permalinks to date and time (empty otherwise)
BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_expires.c>
ExpiresActive On
ExpiresByType image/jpg "access plus 1 year"
ExpiresByType image/jpeg "access plus 1 year"
ExpiresByType image/gif "access plus 1 year"
ExpiresByType image/png "access plus 1 year"
ExpiresByType text/css "access plus 1 month"
ExpiresByType application/pdf "access plus 1 month"
ExpiresByType text/javascript "access plus 1 month"
ExpiresByType text/html "access plus 5 minutes"
ExpiresByType image/x-icon "access plus 1 year"
ExpiresDefault "access plus 6 hours"
</IfModule>
<ifModule mod_headers.c>
Header set X-Endurance-Cache-Level "2"
</ifModule>
Options -Indexes
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^/wp-content/endurance-page-cache/ - [L]
RewriteCond %{REQUEST_METHOD} !POST
RewriteCond %{QUERY_STRING} !.*=.*
RewriteCond %{HTTP_COOKIE} !(wordpress_test_cookie|comment_author|wp\-postpass|wordpress_logg$
RewriteCond %{DOCUMENT_ROOT}/wp-content/endurance-page-cache/$1/_index.html -f
RewriteRule ^(.*)$ /wp-content/endurance-page-cache/$1/_index.html [L]
</IfModule>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
apache2.conf
...
<Directory /home/ubuntu/sites/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
...
vhost for site
...
DocumentRoot /home/ubuntu/sites/my-wp-site.com
...
<Directory /home/ubuntu/sites/my-wp-site.com>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
...
DocumentRoot
? When you say the vHost has the necessaryDirectory
section, can you confirm the file system path this is set for. Please include the contents of your .htaccess file and where exactly this is located. If you add some nonsense to your .htaccess file, does it “break”?|wordpress_logg$
- which implies either mod_rewrite is not enabled or.htaccess
overrides are not enabled (otherwise you'd be getting a 500 response).DocumentRoot
is set to/home/ubuntu/sites
, but are accessing your site asexample.com/my-wp-site/
then the "front page" would render correctly but permalinks would not. However, the "syntax error" I mentioned above is a show-stopper and suggests your vHost/server config is indeed misconfigured (as stated).