Keep Server Online
If you find the Apache Lounge, the downloads and overall help useful, please express your satisfaction with a donation.
or
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.
| |
|
Topic: mod_rewrite redirect |
|
Author |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Wed 26 Jul '17 10:23 Post subject: mod_rewrite redirect |
|
|
I have different languages' sites like
Code: | mydomain/en/mobile
mydomain/de/mobile
|
New mobile websites are coming and the url has changed from f.x. /en/mobile to /mobile/en , so i want to redirect just few pages, and later all to new link. I have such rule implemented for single language and it works :
Code: | RewriteEngine On
RewriteCond %{REQUEST_URI} ^/en/mobile/(.*)$
RewriteRule (.*) https://%{HTTP_HOST}/mobile/en [L,R=301] |
Now i need two rules - one which redirect all languages and one which redirects just few of them - f.x. en/de/fr should be redirected but others shouldn't be. |
|
Back to top |
|
Qmpeltaty
Joined: 06 Feb 2008 Posts: 182 Location: Poland
|
Posted: Wed 26 Jul '17 14:55 Post subject: |
|
|
Here is what worked for my case :
Code: |
RewriteRule ^/(en|de)/mobile(.*)$ https://%{HTTP_HOST}/mobile/$1 [L,R=301] |
|
|
Back to top |
|
|
|
|
|
|