Page 1 of 1

Help to write ReWrite Rule

PostPosted: 31. May 2016 08:19
by jponnusamy
Dear All,
I am new to Apache, We have requirement to hide subfolder from User perspective like below:

Code: Select all
Existing URL: http://cmspweb1.com/sites/fr_CA/xxxx
Expecting URL: http://cmspweb1.com/sites/fr/xxxx


We dont have any folder called fr, So If I use below rewrite rule, its replacing fr_CA with fr, but getting 404 Error. Kindly please let me know if I missed anything.

Code: Select all
RewriteRule ^/sites/fr_CA/(.*) http://cmspweb1.com/sites/fr/$1




I tried Lot but nothing is working. Kindly please help me on this
Thanks
Jay

Re: Help to write ReWrite Rule

PostPosted: 31. May 2016 18:49
by Nobbie
jponnusamy wrote:We dont have any folder called fr, So If I use below rewrite rule, its replacing fr_CA with fr, but getting 404 Error.


Of course, because you are doing it just in the wrong direction. You have to replace "fr" by "fr_CA", and not "fr_CA" by "fr".

Re: Help to write ReWrite Rule

PostPosted: 02. June 2016 12:33
by jponnusamy
Dear Nobbie,
Thanks for the reply.
Actually we dont have any folder called fr and we have only fr_CA, but we dont want to show fr_CA to client browser. and want to show fr instead of fr_CA only on browser. Mean fr should show fr_CA's contents.
Thanks
Jayaram