如何从永久链接中删除'index.php'[WordPress on Composer]

问题描述 投票:0回答:1

我有本地服务器,我正在使用Composer运行WordPress。

数据库从本地迁移到AWS RDS之后,永久链接改变了它的行为:现在标记的开头有'index.php',例如:

http://example.com/index.php /名称的页面

此外,在wp-admin-> Settings-> Permalinks中,结构现在是自定义的:

/index.PHP/%year%/%month num%/%大约%/%post那么%/

我本地服务器的详细信息:

  • Xubuntu 18
  • 的Apache2
  • 适用于/var/www/的AllowOverride All
  • 它在Composer上,带有自定义目录(wp-content与wp core分开)
  • 的.htaccess: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /project/public/wp/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /project/public/wp/index.php [L] </IfModule> # END WordPress

我尝试过的:

http://dejanjanosevic.info/remove-index-php-permalink-in-wordpress/

http://derekmolloy.ie/remove-index-php-from-your-wordpress-url/

  • 更新永久链接
  • 更新作曲家
  • 把我的灵魂卖给撒旦

结果是什么?

修改.htaccess没有效果 - 只是在404结束,唯一有用的链接仍然是包含qazxsw poi的链接。从WordPress更新永久链接具有相同的结果。

我这里的想法已经不多了。

wordpress .htaccess composer-php permalinks
1个回答
0
投票

我懂了。

对于寻找同一问题解决方案的人,这里的指南:

  1. 将wp-admin中的永久链接设置更改为非常永久链接
  2. 在apache中安装mod_rewrite模块
  3. 最重要的部分,在etc / apache / apache2.conf中(注意你必须更改文件夹的名称): /index.php/ 重启apache
© www.soinside.com 2019 - 2024. All rights reserved.