Redirect URLs in Magento using .htaccess file

Some time ago, I’ve showed that how you can redirect URLs in Magento using URL Rewrite Management built in feature of Magento. Sometimes it happens when you can’t redirect URL using URL Rewrite Management; at that time you can use the file .htaccess to redirect those URLs. There are different syntaxes to redirect URL in .htaccess file but the following method works for Magento. Follow the steps to redirect URLs.

  • Open the .htaccess file of your Magento website.
  • Search for the field “enable rewrites” in that file. You can find your previous URL rewrites here and you should done your all the URL rewrite here as it’s best practices to put your all URL redirection at same place.
  • Here is the syntax to redirect any URL:
    RewriteEngine on
  • You don’t have to write “RewriteEngine on” every time.  It is just one time process. RewriteEngine should be enabled to order to redirect the URLs from .htaccess.
  • Save these changes in .htaccess file.

And you’re done; you can check the old URL which will be now redirected to New URL if you followed the procedure correct.

Drop me a line if you are unable to redirect URL using this method.

3 Responses to “Redirect URLs in Magento using .htaccess file”

  1. Paul Says:

    Hi, Thank you for taking time to created this article.

    I did what you wrote but it’s not work on my end.

    What I do was:
    1) Created .htaccess under “/httpdocs/magento” since it don’t have an .htaccess.
    2.) Place the code below. I created 3 different line to check but nothing worked from 3 sample.

    RewriteEngine on
    RewriteRule ^/index.php/html.html?$ [R=301,L]
    RewriteRule /index.php/html.html$ [R=301,L]
    RewriteRule /index.php/html.html [R=301,L]

    Do you have an idea what is going on?

  2. alok Says:

    i want to change a part of url not whole url. For example “customer/acoount/” page rewrite to “customer/acoount/edit” page. Kindly help ….

  3. Great Ubuntu Server Guides Says:

    Remarkable things here. I’m very satisfied to look your article.

    Tanks so much and I am looking ahead to touch you.
    Will you kindly droop me a e-mail?

Speak Your Mind

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: