问题
My setup: I have domain.com pointing to Server 1 and have set up blog.domain.com to point to another wordpress Server 2 that hosts multiple wordpress sites. Server 2 has multiple wordpress sites in a single Ubuntu server as per these instructions. Because this manual is outdated, I also follow wordpress virtual host configuration based on Step 4 detailed in this post. Describing my setup up front because I'm not sure if my problem is because of this setup.
Question:
Based on this setup, Wordpress works fine with the default permalink option. Below are the details in my conf file
DocumentRoot /var/www/domain
ServerName blog.domain.com
ServerAlias blog.domain.com
<Directory "/var/www/domain">
Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all
</Directory>
When plain permalinks are selected, my htaccess file in /var/www/domain is empty and everything works fine.However, when I change the permalink to Post name (blog.domain.com/sample-post/) the homepage (blog.domain.com) works fine but my individual post url (blog.domain.com/sample-post/) does not work. My htaccess file looks like this:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
WordPress Address (URL) = blog.domain.com Site Address (URL) = blog.domain.com
Could you please help resolve this. I'd like permalinks to be enabled but have been stuck with this issue for several months. Really appreciate all your comments & feedback.
回答1:
I was able to resolve this by following instructions by Robert in this thread - WordPress Multisite 404 error on posts and subsites
来源:https://stackoverflow.com/questions/62113159/wordpress-permalink-issue-w-subdomains