0

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:

  1. Enable mod_rewrite.
  2. Modify httpd.conf with:

    <Directory /var/www/>
        Options Indexes FollowSymLinks
        AllowOverride All
        Require all granted
    </Directory>
    
  3. Reset permalinks to default and change back as desired.

  4. Delete .htaccess.

  5. 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?

0

At 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.