m0tSiE
asked on
.htacess redirect not working
Hi,
I've just changed the name of one of my php pages and I'm wanting to redirect requests made to the former filename to go to the new filename.
The old page is:
news/event.php?event=
The new page is:
news/predictions.php?event =
I tried using this in .htaccess:
RewriteRule ^news/predictions.php?even t=([0-9]{2 }) news/predictions.php?event =$1 [r=301,nc]
I tried accessing the orginal url but it didnt redirect me to the new one. Can anyone see where i'm going wrong?
Thanks,
Paul
Am I using this wrong? I tried
I've just changed the name of one of my php pages and I'm wanting to redirect requests made to the former filename to go to the new filename.
The old page is:
news/event.php?event=
The new page is:
news/predictions.php?event
I tried using this in .htaccess:
RewriteRule ^news/predictions.php?even
I tried accessing the orginal url but it didnt redirect me to the new one. Can anyone see where i'm going wrong?
Thanks,
Paul
Am I using this wrong? I tried
ASKER
Thanks Derokorian, I tried your code and it does redirect but it uses the full server path including public_html, etc. is there a way to stop it adding in those extra folders? or should I just change news/predictions.php to the full url?
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
Thanks guys, worked perfectly.
:)
:)
RewriteRule ^news/event.php$ news/predictions.php [QSA,R=301,NC]
HTH