Help On URL Rewrites

Problems with the Linux version of XAMPP, questions, comments, and anything related.

Help On URL Rewrites

Postby jponnusamy » 07. August 2016 11:05

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
jponnusamy
 
Posts: 6
Joined: 31. May 2016 08:06
XAMPP version: 2.3
Operating System: Redhat 6

Re: Help On URL Rewrites

Postby Nobbie » 07. August 2016 11:08

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.
Nobbie
 
Posts: 8779
Joined: 09. March 2008 13:04

Re: Help On URL Rewrites

Postby jponnusamy » 07. August 2016 11:37

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
jponnusamy
 
Posts: 6
Joined: 31. May 2016 08:06
XAMPP version: 2.3
Operating System: Redhat 6

Re: Help On URL Rewrites

Postby Nobbie » 07. August 2016 21:29

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.
Nobbie
 
Posts: 8779
Joined: 09. March 2008 13:04


Return to XAMPP for Linux

Who is online

Users browsing this forum: No registered users and 4 guests