wordpress remove index.php

时间:2015-10-20 13:58:33

标签: php wordpress .htaccess

我不确定问题是我按照删除index.php的步骤

  1. 已添加到.htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
  2. 选定的自定义结构

  3.   

    http://11.33.55.77/%pagename%/

    我访问的任何页面都是404,例如

      

    http://url.com/faq = 404

    在此服务器上找不到请求的URL / faq。

2 个答案:

答案 0 :(得分:0)

确保faq页面的永久链接实际上是/ faq,如果设置正确,请确保在apache中启用了mod_rewrite

答案 1 :(得分:0)

  1. 确保已启用mod_rewrite。 sudo a2enmod重写。 这对我不起作用
  2. 转而使用apache2 / sites-available / default-000.conf

     <Directory />
        Options FollowSymLinks
        AllowOverride All
        </Directory>
    
        <Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all
        </Directory>
    

    复制并粘贴以下配置

相关问题