admin管理员组文章数量:1130349
Some pages of my Wordpress don't work after creating a custom permalink for products URL in my localhost environment. Home page works, but for example /contact page returns 404. If I look at Apache log, it appears a 404 from /contact. My environment is with WAMP and Windows 10.
I have tried the most common things I have read like:
- Enable mod_rewrite.
Modify httpd.conf with:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>Reset permalinks to default and change back as desired.
Delete .htaccess.
And also:
<Directory /> Options FollowSymLinks AllowOverride All </Directory>
mod_rewrite is enabled, Wordpress have permission to edit .htaccess and if I delete .htaccess and recreate permalinks, htaccess is created again.
My permalinks are %parent_category% and %keyword%, so URL for products are: .../parent_category/keyword/product-name.
For %parent_category%, I get the parent category of the product (WooCommerce) and for %keyword% I get it from Yoast SEO keyword field of the product.
What else can I check?
Some pages of my Wordpress don't work after creating a custom permalink for products URL in my localhost environment. Home page works, but for example /contact page returns 404. If I look at Apache log, it appears a 404 from /contact. My environment is with WAMP and Windows 10.
I have tried the most common things I have read like:
- Enable mod_rewrite.
Modify httpd.conf with:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>Reset permalinks to default and change back as desired.
Delete .htaccess.
And also:
<Directory /> Options FollowSymLinks AllowOverride All </Directory>
mod_rewrite is enabled, Wordpress have permission to edit .htaccess and if I delete .htaccess and recreate permalinks, htaccess is created again.
My permalinks are %parent_category% and %keyword%, so URL for products are: .../parent_category/keyword/product-name.
For %parent_category%, I get the parent category of the product (WooCommerce) and for %keyword% I get it from Yoast SEO keyword field of the product.
What else can I check?
Share Improve this question asked Oct 31, 2018 at 0:25 SergioSergio 1012 bronze badges1 Answer
Reset to default 0At the end it was because I wasn't writing a product base. So, after writing a product base like /product/%parent_category%/%keyword% everything worked fine. Besides, I used a plugin called Woocommerce Permalink Manager to remove the "product" from the URL.
Some pages of my Wordpress don't work after creating a custom permalink for products URL in my localhost environment. Home page works, but for example /contact page returns 404. If I look at Apache log, it appears a 404 from /contact. My environment is with WAMP and Windows 10.
I have tried the most common things I have read like:
- Enable mod_rewrite.
Modify httpd.conf with:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>Reset permalinks to default and change back as desired.
Delete .htaccess.
And also:
<Directory /> Options FollowSymLinks AllowOverride All </Directory>
mod_rewrite is enabled, Wordpress have permission to edit .htaccess and if I delete .htaccess and recreate permalinks, htaccess is created again.
My permalinks are %parent_category% and %keyword%, so URL for products are: .../parent_category/keyword/product-name.
For %parent_category%, I get the parent category of the product (WooCommerce) and for %keyword% I get it from Yoast SEO keyword field of the product.
What else can I check?
Some pages of my Wordpress don't work after creating a custom permalink for products URL in my localhost environment. Home page works, but for example /contact page returns 404. If I look at Apache log, it appears a 404 from /contact. My environment is with WAMP and Windows 10.
I have tried the most common things I have read like:
- Enable mod_rewrite.
Modify httpd.conf with:
<Directory /var/www/> Options Indexes FollowSymLinks AllowOverride All Require all granted </Directory>Reset permalinks to default and change back as desired.
Delete .htaccess.
And also:
<Directory /> Options FollowSymLinks AllowOverride All </Directory>
mod_rewrite is enabled, Wordpress have permission to edit .htaccess and if I delete .htaccess and recreate permalinks, htaccess is created again.
My permalinks are %parent_category% and %keyword%, so URL for products are: .../parent_category/keyword/product-name.
For %parent_category%, I get the parent category of the product (WooCommerce) and for %keyword% I get it from Yoast SEO keyword field of the product.
What else can I check?
Share Improve this question asked Oct 31, 2018 at 0:25 SergioSergio 1012 bronze badges1 Answer
Reset to default 0At the end it was because I wasn't writing a product base. So, after writing a product base like /product/%parent_category%/%keyword% everything worked fine. Besides, I used a plugin called Woocommerce Permalink Manager to remove the "product" from the URL.
本文标签: Custom permalink gives 404 error only in some pages
版权声明:本文标题:Custom permalink gives 404 error only in some pages 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749205831a2332512.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论