Author |
|
jponnusamy
Joined: 30 May 2016 Posts: 12 Location: Qatar, Doha
|
Posted: Tue 31 May '16 9:18 Post subject: Help on ReWriteRule |
|
|
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
|
Posted: Tue 31 May '16 10:37 Post subject: |
|
|
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
|
Posted: Wed 01 Jun '16 9:09 Post subject: |
|
|
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
|
Posted: Wed 01 Jun '16 10:05 Post subject: |
|
|
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
|
Posted: Thu 02 Jun '16 13:27 Post subject: |
|
|
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
|
|
Back to top |
|
jponnusamy
Joined: 30 May 2016 Posts: 12 Location: Qatar, Doha
|
Posted: Sun 05 Jun '16 13:33 Post subject: |
|
|
No, getting 404 Error |
|
Back to top |
|
Steffen Moderator
Joined: 15 Oct 2005 Posts: 3094 Location: Hilversum, NL, EU
|
Posted: Sun 05 Jun '16 13:41 Post subject: |
|
|
Rewriting to a non-existing url, does not make sense |
|
Back to top |
|
jponnusamy
Joined: 30 May 2016 Posts: 12 Location: Qatar, Doha
|
Posted: Sun 05 Jun '16 13:47 Post subject: |
|
|
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
|
Posted: Sun 05 Jun '16 13:50 Post subject: |
|
|
Maybe someone else can hopefully help you. |
|
Back to top |
|
James Blond Moderator
Joined: 19 Jan 2006 Posts: 7373 Location: Germany, Next to Hamburg
|
|
Back to top |
|