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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.