Jump to content

Redirect


ozestretch

Recommended Posts

Hi, I am looking to redirect URLS from:

 

mypage.php?id1=this&id2=that&id3=&id4=&id5=&id6=&id7=last

 

to

 

mypage--id7-id1-id2

 

id1 alphanumeric, id2 numeric id7 (may have special chars (- + &))

 

this is what I have tried

 

Options +FollowSymlinks
RewriteEngine on
RewriteRule ^mypage-([^\n]+)--([0-9a-z]+)-([0-9]+)$ /mypage.php?id1=$2&id2=$3&id3=&id4=&id5=&id6=&id7=$1 [NC]

RewriteRule ^mypage\.php\?id1=([0-9A-Za-z]+)&id2=([0-9]+)&id3=&id4=&id5=&id6=&id7=([^\n]*)$ mypage-$3--$1-$2 [R=301,NC,L]

 

It handles 1 part fine, mypage--id7-id1-id2 is read as mypage.php?id1=this&id2=that&id3=&id4=&id5=&id6=&id7=last

 

I just want it to redirect the old non SEO url then read as this is updating a site with a couple thousand pages already linked on the net.

 

Ideas welcomed.

Link to comment
https://forums.phpfreaks.com/topic/230076-redirect/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.