Changing the current URL but serving content from another (same domain) - ProxyPass?

Posted by zigojacko on Server Fault See other posts from Server Fault or by zigojacko
Published on 2014-06-05T15:23:37Z Indexed on 2014/06/05 15:26 UTC
Read the original article Hit count: 224

I've been banging my head against the wall with this for months now so I hope someone on here will be able to finally advise what is needed for this.

I have some URL's like this:-

domain.com/category/subcat/filter/brand

And I wish to rewrite the URL's to:-

domain.com/category/brand-subcat

Content loads fine at the first URL, I just want to show it at a different URL - is URL masking the correct term for this?

I have a RewriteRule in .htaccess that should do this job as far as I believe:-

RewriteRule ^([a-zA-Z]+)/([a-zA-Z]+)/filter/([a-zA-Z]+)$ $1/$3-$2

This isn't actually modifying the URL at all though on a Magento website (mod_rewrite is enabled and plenty of other rewrites are working from the same .htaccess).

So firstly, I want to know is what I am trying to achieve definitely possible? If so, what is this process even called?

Secondly, does this need to be handled using ProxyPass and then use a [P] flag with the rewrite rule? I assume the Apache server doesn't have mod_proxy enabled currently because when I add a [P] flag, the URL returns a 403 forbidden error with the full server path for the current URL.

Please could anyone kindly advise what on earth I need to do to achieve this?

© Server Fault or respective owner

Related posts about .htaccess

Related posts about mod-rewrite