Click here to Skip to main content
15,907,687 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Greetings,
I need your advice.

I implemented the rewrite mod for the articles, switching from a dynamic url to a static url like this:

RewriteRule ^([^/]+)/([^/]+).htm /testo.php?Id=$1&nomefile=$2 [L]


Everything works fine, but there is a problem when I do a redirect 301 like this:
Redirect 301 /11/pippo.htm /11/super-pippo.htm


i.e. redirect 301 from https://www.sito.it/11/pippo.htm to https://www.sito.it/11/super-pippo.htm

Well in this case it also brings the variables with it and I get this wrong link:
https://www.sito.it/11/super-pippo.htm?Id=11&nomefile=pippo
instead it should be:
https://www.sito.it/11/super-pippo.htm

I'm definitely missing something at the moment, if possible I'm waiting for your professional support.

Thank you

What I have tried:

Resolve problem Redirect 301 that generates incorrect static URL with variables
Posted
Updated 15-Sep-23 9:06am

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900