【问题标题】:changing the .htaccess file in wordpress在 wordpress 中更改 .htaccess 文件
【发布时间】:2013-09-10 03:29:17
【问题描述】:

我试图在我的localhost 上使用WordPress 中的permalink feature,所以当我点击post name from Common Settings 时,我只是复制了generated by WordPress 的代码。我将生成的代码保存在我的本地主机中,其中wordpress index.php 文件以.htaccess 的名称存储,现在当我要访问该页面时,browser is showing the full address of the post 的网址栏是post can not be seen on the browser。只有@ 987654330@。有人可以告诉我这里有什么问题吗?

【问题讨论】:

    标签: wordpress .htaccess


    【解决方案1】:

    你应该让 wordpress 为你的 localhost 服务器写这个文件。

    您不能简单地从另一台服务器复制.htaccess 并期望它会起作用,您必须对其进行修改以反映您的服务器配置。

    您应该修改RewriteBase 和最后一个RewriteRule,例如对于http://localhost/wordpress

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /wordpress/
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /wordpress/index.php [L]
    </IfModule>
    

    【讨论】:

    • @MadanBhandari 在 .htaccess 文件中,如下文所述。
    • 谢谢,按预期工作。但是,如果您在 Windows localhost 上托管您的网站,您只需将 /wordpress/ 更改为您的实际目录名称。谢谢
    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-09-02
    • 1970-01-01
    • 1970-01-01
    • 2014-04-01
    • 2014-01-08
    • 1970-01-01
    相关资源
    最近更新 更多