I hope some Apache gurus out there can help me. I want to redirect all the url of my old website to a new website. Both are Drupal sites.

For example:
From old url
http://www.example.com/en/article/2010/example-title-is-here (I stored Drupal files inside an 'en' folder; silly mistake I made)

To new url
http://www.example.com/article/2010/example-title-is-here (without 'en')

Your help is greatly appreciated. Thanks in advance.

Comments

shawnmeng’s picture

You can simply add code below into your .htaccess file in Drupal root directory.

RewriteRule ^en/(.*)$ http://www.example.com/$1 [R=301,L]

This line should before

# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_URI} !=/favicon.ico
 RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

Hope this can help you!

seakayjay’s picture

Thank you so much.

kendre_paresh’s picture

shawnmeng, could you please help me.

My url is www.returnspoint.com, but when i type it in address bar and hit enter button, it shows http://174.129.8.40

I want to show name only instead of IP address, Could you please advice me what i need to change in .htaccess and/or in apachew conf file.