Link to home
Start Free TrialLog in
Avatar of intangiblemedia
intangiblemediaFlag for Afghanistan

asked on

.HTACCESS Rewrite Rule 301

Hi,

I have various hundred URL's that have been indexed in google and I need to resolve them and redirect them. The pattern is like this:

www.mydomain.com/en/decor/somefolder-1/somepage-1.html?p=4
www.mydomain.com/it/somepage-1.html
www.mydomain.com/es/somefolder/anotherfolder-1/somepage.html

The CMS I use, Magento, has a rewrite module that fails sometimes and adds -1 to folders and to .html files.

As you can see, I would need a rewrite rule that would take off the -1 for the folders and the -1 just before the .html for pages.

I would need it to 301 the incoming requests based on above and rewrite them to:

www.mydomain.com/en/decor/somefolder/somepage.html?p=4
www.mydomain.com/it/somepage.html
www.mydomain.com/es/somefolder/anotherfolder/somepage.html

Your help is greatly appreciated.

thanks!
ASKER CERTIFIED SOLUTION
Avatar of ahoffmann
ahoffmann
Flag of Germany image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of intangiblemedia

ASKER

thanks for your answer - I tried them, but both give me http 500 errors and site doesnt load...
can you please post the corresponding entry from your error-log