我之前安装了几个WordPress服务器,但这是我第一次遇到这个问题,所有的链接都必须在URL中有'index.php‘(即,不是test.com/WordPress,而是test.com/index.php/index.php),我搜索了几个问题,这里有一个类似的帖子:Remove index.php from Wordpress URLs,但它没有给出我的问题的答案
HYG来自我的服务器的一些详细信息:
1)启用mod_rewrite
2)我有一个虚拟主机配置:
# domain name: test.com 
# public: /var/www/test.com 
# Admin email, Server Name (domain name) and any aliases 
ServerAdmin test@gmail.com 
ServerName test.com 
ServerAlias www.test.com 
# Index file and Document Root (where the public files are located) 
# DirectoryIndex index.php 
DocumentRoot /var/www/test.com 
# Custom log file locations 
LogLevel warn 
ErrorLog /var/log/apache2/error-test.com.log 
CustomLog /var/log/apache2/access-test.com.log combined 3)我的.htaccess如下:
Options FollowSymLinks 
AllowOverride All
# BEGIN WordPress 
RewriteEngine On 
RewriteBase / 
RewriteRule ^index.php$ - [L] 
RewriteCond %{REQUEST_FILENAME} !-f 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule . /index.php [L] 
# END WordPress4) WordPress目录权限为rwsr_xr_x,文件为rwx_r__r__ (owner www-data:www-data)
5)固定链接配置为/%year%/%monthnum%/%day%/%postname%/
我对.htaccess格式不熟悉,所以可能需要调整一些,请告诉我?
https://stackoverflow.com/questions/51161570
复制相似问题