Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

remove a specific part from url with htaccess and redirect

I was using translatepress on my wordpress site so my site urls were like dynamiclinic.com/en-ae/hair-transplant but now I have removed translatepress so now my urls are like dynamiclinic.com/hair-transplant but I have submitted urls for SEO with en-ae slug. I want that if en-ae is present in any URL then it gets removed automatically and gets redirected to page without en-ae. For 1 example
dynamiclinic.com/en-ae/hair-transplant redirects to dynamiclinic.com/hair-transplant

>Solution :

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

You need the rewrite module of Apache: mod_rewrite.

Then in your htaccess this:

RewriteEngine on 
RewriteRule ^en-ae/(.*)$ $1
Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading