繁体   English   中英

在wordpress中更改.htaccess文件

[英]changing the .htaccess file in wordpress

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

您应该让wordpress为您的本地主机服务器写入此文件。

您不能简单地从另一台服务器复制.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>

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM