Ask your WordPress questions! Pay money and get answers fast! Comodo Trusted Site Seal
Official PayPal Seal

Rewrite URLs to allow domain extensions WordPress

I have a custom taxonomy on my site for online stores which has many websites listed (as terms).

At the moment the term slugs are all 'sanitized' to only include hyphens so a url looks like - domain.com/stores/amazon-com

I'd like to leave the sanitization as is , but want these URLs to show up as the actual domains with extensions in the urls for the site (in archives urls, etc.) such as - domain.com/stores/amazon.com

I only want this to happen for the terms in the 'stores' taxonomy though, not for all URLs that contain a domain with an extension.

I would really like this to be done via a rewrite for the URLs or a custom function.

e.g.
I want the rewrite to change this:
domain.com/stores/amazon-com
to this:
domain.com/stores/amazon.com

But NOT change this:
domain.com/products/product-is-from-amazon-com

Can anybody assist with this?

Answers (0)

No answers yet.