最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

permalinks - Woocommerce posts and products links works only once and then get 404 error

programmeradmin2浏览0评论

Permalink to products and post of my website getting 404 error. after saving the permalink type in Setting -> Permalink page they will work correctly. But if I refresh the links they get 404 error again. Actually the links work only once.

this is my .htaccess file:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^.*-(\d+)/$ securityl/index\.php?id=$1&%{QUERY_STRING} [L]
RewriteRule ^.*-y(\d+)/$ securityl/index\.php?cat=$1&%{QUERY_STRING} [L]
RewriteRule ^.*(website[a-z]+map\.xml)$  websiteguide/$1 [L]

RewriteBase /
</IfModule>

I have changed the theme to store front and it's not working.

Permalink to products and post of my website getting 404 error. after saving the permalink type in Setting -> Permalink page they will work correctly. But if I refresh the links they get 404 error again. Actually the links work only once.

this is my .htaccess file:

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^.*-(\d+)/$ securityl/index\.php?id=$1&%{QUERY_STRING} [L]
RewriteRule ^.*-y(\d+)/$ securityl/index\.php?cat=$1&%{QUERY_STRING} [L]
RewriteRule ^.*(website[a-z]+map\.xml)$  websiteguide/$1 [L]

RewriteBase /
</IfModule>

I have changed the theme to store front and it's not working.

Share Improve this question asked Jul 6, 2020 at 19:42 ErfanErfan 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 0

I realized that some php code changes the content of .htaccess file. The php folder was in a directory named 'securityl'. I've been removed that directory but whenever the website was refreshing the directory and also the php files inside it was recreating. In the end I discovered that some code in wp-include/load.php is creating the directory and I re-downloaded the wordpress and replaced the clean wp-include, then the problem solved and there was no code for creating securityl folder! . I don't know how and why the contents of that files were changed.

发布评论

评论列表(0)

  1. 暂无评论