logo
Apache Lounge
Webmasters

 

About Forum Index Downloads Search Register Log in RSS X


Keep Server Online

If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.

or

Bitcoin

A donation makes a contribution towards the costs, the time and effort that's going in this site and building.

Thank You! Steffen

Your donations will help to keep this site alive and well, and continuing building binaries. Apache Lounge is not sponsored.
Post new topic   Forum Index -> Apache View previous topic :: View next topic
Reply to topic   Topic: Help on ReWriteRule
Author
jponnusamy



Joined: 30 May 2016
Posts: 12
Location: Qatar, Doha

PostPosted: Tue 31 May '16 9:18    Post subject: Help on ReWriteRule Reply with quote

Dear All,
I am new to Apache, We have requirement to hide subfolder from User perspective like below:

Code:
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:
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
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3094
Location: Hilversum, NL, EU

PostPosted: Tue 31 May '16 10:37    Post subject: Reply with quote

Is this the same issue in your other post before ?

Did you try:

RewriteRule /sites/fr_CA/(.*) http://cmspweb1.com/sites/fr/$1 [R=301,L]
Back to top
jponnusamy



Joined: 30 May 2016
Posts: 12
Location: Qatar, Doha

PostPosted: Wed 01 Jun '16 9:09    Post subject: Reply with quote

Dear Steffen,

Thanks for your response, I tried URL is getting change but page is not loading.
"The request page doesn't exist. Please double check to make sure you have the correct URL."
Kindly please help on this.
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3094
Location: Hilversum, NL, EU

PostPosted: Wed 01 Jun '16 10:05    Post subject: Reply with quote

RewriteEngine on ?

You can also try:

RedirectMatch "^/sites/fr_CA/(.*)" "http://cmspweb1.com/sites/fr/$1"
Back to top
jponnusamy



Joined: 30 May 2016
Posts: 12
Location: Qatar, Doha

PostPosted: Thu 02 Jun '16 13:27    Post subject: Reply with quote

Hi Steffen,

Yes RewriteEngine On

URL is getting change as expected
http://cmspweb1.com/sites/fr/xxxx
But still getting Page cannot be displayed page only.

Thanks
Jayaram
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3094
Location: Hilversum, NL, EU

PostPosted: Thu 02 Jun '16 13:50    Post subject: Reply with quote

http://cmspweb1.com/sites/fr/xxxx , does it exist when you type it in your browser ?
Back to top
jponnusamy



Joined: 30 May 2016
Posts: 12
Location: Qatar, Doha

PostPosted: Sun 05 Jun '16 13:33    Post subject: Reply with quote

No, getting 404 Error
Back to top
Steffen
Moderator


Joined: 15 Oct 2005
Posts: 3094
Location: Hilversum, NL, EU

PostPosted: Sun 05 Jun '16 13:41    Post subject: Reply with quote

Rewriting to a non-existing url, does not make sense Smile
Back to top
jponnusamy



Joined: 30 May 2016
Posts: 12
Location: Qatar, Doha

PostPosted: Sun 05 Jun '16 13:47    Post subject: Reply with quote

Actually we want to show fr_CA as fr, but we dont have "fr" folder exist on our system.

Is there any way to do it, Kindly please help me on this.

Thanks
Jayaram
Back to top
admin
Site Admin


Joined: 15 Oct 2005
Posts: 692

PostPosted: Sun 05 Jun '16 13:50    Post subject: Reply with quote

Maybe someone else can hopefully help you.
Back to top
James Blond
Moderator


Joined: 19 Jan 2006
Posts: 7373
Location: Germany, Next to Hamburg

PostPosted: Sun 05 Jun '16 18:40    Post subject: Reply with quote

Double Post? https://www.apachelounge.com/viewtopic.php?t=7160
Back to top


Reply to topic   Topic: Help on ReWriteRule View previous topic :: View next topic
Post new topic   Forum Index -> Apache