skip to Main Content

URL applying rule(s):

https://olddomain.ch/de/qahmkitd73/
https://olddomain.ch/fr/qahmkitd73/ 
https://olddomain.ch/en/qahmkitd73/ 

RewriteCond %{HTTP_HOST} chezcamillebloch.ch$
RewriteCond %{REQUEST_URI} ^/.*/qahmkitd73/$ [NC]
RewriteRule .* https://newdomain.ch/$1/qahmkitd73 [NE,R=301,L]

this should redirect to https://newdomain.ch/**/qahmkitd73
the ** should be dynamic from the URL (de/ or en/ or fr/)

2

Answers


  1. You could keep your .htaccess rules file in following manner. Please make sure to clear your browser cache before testing your URLs.

    RewriteEngine ON
    RewriteCond %{HTTP_HOST} ^(?:www.)?olddomain.ch$  [NC]
    RewriteRule ^ http://newdomain.ch/%{REQUEST_URI} [R=301,NE,L]
    
    Login or Signup to reply.
  2. this should redirect to https://newdomain.ch/**/qahmkitd73 the ** should be dynamic from the URL (de/ or en/ or fr/)

    You may use this redirect rule:

    RewriteEngine On
    
    RewriteCond %{HTTP_HOST} ^(?:www.)?olddomain.ch$ [NC]
    RewriteRule ^(en|fr|de)/qahmkitd73/?$ http://newdomain.ch%{REQUEST_URI} [R=301,NC,L]
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search