Jump to content

.htaccess - Redirecting .aspx links to home page?


WZ810

Recommended Posts

I switched to PrestaShop from a server using .aspx. I'm on apache now. Google webmaster is showing a lot of 404's because the old website content no longer exists, and people are still linking to it. All my new pages use .php or .html. I just want all of the old pages that contain .aspx anywhere in the URL to redirect to my home page (http://www.mysite.com).

Here is what I have so far in my .htaccess:

# .aspx extentions redirected to home index because of old site
RedirectMatch 301 /(.*)\.aspx /



This works for links that end and stop at .aspx.
Example: http://www.mysite.com/-Product/p337135_823541.aspx
To: http://www.mysite.com

BUT it won't work for links like this: http://www.mysite.com/-Product/index.aspx?pageid=337136&category=254039
They turn into: http://www.mysite.com/?pageid=337136&category=254039

How do I get that ?pageid=337136&category=254039 part off of there?

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...