简体   繁体   English

设置为postname时,WordPress永久链接不起作用

[英]Wordpress permalink is not working when set to postname

I have problem with my WordPress permalink. 我的WordPress固定链接有问题。 I'm running a WAMP server. 我正在运行WAMP服务器。 I tried to change the permalink to postname: "/%postname%/" . 我试图将永久链接更改为postname: "/%postname%/"

固定链接设置。

When I test one of my pages I get an 404 Not Found. 当我测试我的页面之一时,我得到404 Not Found。

当我点击帖子标题时。

How can I fix this problem? 我该如何解决这个问题?

Looks like your .htaccess doesn't exists or better said the mod_rewrite isn't working. 看来您的.htaccess不存在,或者最好是说mod_rewrite无法正常工作。

My guess though, since you are using wamp, is that the .htaccess was created by wordpress. 但是,由于您使用的是wamp,我的猜测是.htaccess是由wordpress创建的。 Just check if the file exists otherwise create it. 只需检查文件是否存在,否则创建它。

Please read the appropriate documentation . 请阅读相应的文档 In short, you should put a file named .htaccess in your root directory and have the following in the file: 简而言之,您应该在根目录中放置一个名为.htaccess的文件,并在文件中包含以下内容:

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

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

相关问题 分页不适用于固定链接的邮政名 - pagination not working with permalink postname WordPress%postname%permalink返回404 - WordPress %postname% permalink returns 404 将永久链接结构更改为postname时,Wordpress localhost产生404页 - Wordpress localhost results in 404 pages when changing permalink structure to postname Wordpress Nginx永久链接从纯名称到邮政名称 - Wordpress Nginx Permalink from plain to postname 手动将 WordPress 数据库从域转移到另一个域,在固定链接中使用 postname - Manually transfer WordPress database from domain to another domain with postname in permalink Wordpress Postname 永久链接在 localhost (xampp) 上不起作用 - Wordpress Postname permalink doesn't work on localhost (xampp) 如何在永久链接设置为“/%postname%/”的情况下从 URL 中删除类别库 - How to remove category base from URL with permalink set to “/%postname%/” 的WordPress-get_permalink返回page_id,而不是%postname%永久链接设置中的错误 - Wordpress - get_permalink to return page_id instead of slug in %postname% permalink setting 403错误-永久链接设置设置为“帖子名称”时,WordPress链接不起作用 - 403 Error - Wordpress link not working when permalink setting is set to 'post name' WordPress的永久链接无法正常工作 - Wordpress permalink is not working
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM