Page 1 of 1

Help On URL Rewrites

PostPosted: 07. August 2016 11:05
by jponnusamy
Hi,

I made below rewriteRule to redirect URL from http://cmspweb1.com/sites/en_US/about/newsroom/2015/4 to http://cmspweb1.com/sites/en_US/about/newsroom?year=2015&month=4
Redirection is happening fine But we want to keep FROM URL (http://cmspweb1.com/sites/en_US/about/newsroom/2015/4) only in the Browser's Address Bar, and the Redirection should happen only Internally.


Code: Select all
RewriteEngine On    # Turn on the rewriting engine
RewriteRule /sites/en_US/about/newsroom/([0-9]+)/([0-9]+) sites/en_US/about/newsroom?year=$1&month=$2 [R]



Kindly please help me on this.

Thanks
Jayaram

Re: Help On URL Rewrites

PostPosted: 07. August 2016 11:08
by Nobbie
jponnusamy wrote:But we want to keep FROM URL (http://cmspweb1.com/sites/en_US/about/newsroom/2015/4) only in the Browser's Address Bar, and the Redirection should happen only Internally.


And why do you apply "[R]" Flag? That causes an external redirect instead of an internal.

Re: Help On URL Rewrites

PostPosted: 07. August 2016 11:37
by jponnusamy
Yes, I removed that I kept [P] Flag, now http://cmspweb1.com/sites/en_US/about/newsroom/2015/4 only appearing on the Address bar as expected. But if I select another month or year and submitted the form from site, Again I am getting URL in this order only http://cmspweb1.com/sites/en_US/about/newsroom?year=2015&month=4

Is there any option which will help to hide year & month parameters from the Addressbar?

Thanks
Jayaram

Re: Help On URL Rewrites

PostPosted: 07. August 2016 21:29
by Nobbie
jponnusamy wrote:But if I select another month or year and submitted the form from site, Again I am getting URL in this order only http://cmspweb1.com/sites/en_US/about/n ... 15&month=4


Its very very very very very very very hard to debug your code without seeing it. You can see it and even dont know how to solve, how can we solve your problem, as you dont show anything???

Maybe you send the form variables via GET instead of POST?? If you have a form an send the form variables via "method=GET", they are applied to the URL. Anyway, all of this is basic HTML knowlegde and or basic Apache knowledge, this forum (Xampp) is not mentioned for teaching HTML. I apply this very last answer, but for any further question, you really should go for an appropriate forum. This forum is "Xampp for Linux", but your question does not deal with either one of Xampp or Linux.