Showing content from pages at different URL's (masking), possibly with .htaccess

Posted by zigojacko on Pro Webmasters See other posts from Pro Webmasters or by zigojacko
Published on 2014-05-01T08:04:32Z Indexed on 2014/06/01 9:42 UTC
Read the original article Hit count: 268

Filed under:
|
|
|

If I have URL's like:-

domain.com/category/widgets/filter/blue
domain.com/category/widgets/filter/red

And it is pretty difficult to reconstruct them to something like:-

domain.com/category/blue-widgets
domain.com/category/red-widgets

Is there any way at all that I can use URL rewrites or anything else with .htaccess or on the server to display the URL's as the domain.com/category/blue-widgets on the domain.com/category/widgets/filter/blue page?

I've looked into masking URL's but got nowhere and this has been something bugging me for almost 6 months now. Is there any way to achieve what I want to do?

FYI: This is a Magento website and the above process, I am wanting to implement for potentially hundreds of URL's.

Edit

To respond to @kkugelmann's answer:-

I couldn't get your proposed RewriteRule to make a difference at all in the .htaccess file so I started testing a few things in this .htaccess tester:-

The proposed RewriteRule didn't work in this tester:-

enter image description here

However, the following did:-

enter image description here

But adding any of these RewriteRule's into the website's .htaccess file did not rewrite the URL at all...

Edit2

By the way, if I add [R=301,L] to the end of the URL rewrite rule, it does actually then rewrite the rule, but of course 301 redirects it as well which is unwanted behaviour.

Edit3

I found another question with the same issue... And an accepted answer that solved the problem which seemed to be something to do with using mod_proxy and the [P] tag on the rule (if I try this, the page 404's).

© Pro Webmasters or respective owner

Related posts about htaccess

Related posts about url