Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: 301 redirects Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
eastwood
Newbie
Newbie


Joined: 24 July 2007
Location: United Kingdom
Online Status: Offline
Posts: 5
Posted: 24 July 2008 at 10:10am | IP Logged Quote eastwood

Client has changed their site but the old pages are still ranked and lsited on search engines

Need to do a 301 redirect on the following pages

index.php?option=com_content&task=view&id=7&Itemid=7 maps to /visa/work/usa/ref/1091


page.asp?id=9
page.asp?id=312
page.asp?id=49
page.asp?id=8
index.php?option=com_content&task=view&id=49&Itemid=3&info=abc+123+Program
index.php?option=com_content&task=view&id=51&Itemid=3&info=abc+123+Program
index.php?option=com_content&task=view&id=63&Itemid=3&info=abc+123+Program

maps to /content/123

 

Any pointers?

 

becuase up till now all the rules I had written were converting seo friendly urls back to dynamic pages with querystring values


Thanks

 



Edited by eastwood - 24 July 2008 at 10:12am
Back to Top View eastwood's Profile Search for other posts by eastwood
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 600
Posted: 24 July 2008 at 2:46pm | IP Logged Quote Vyacheslav

Hi Jon.
Please try the following:
Code:
RewriteCond %{QUERY_STRING} id=(9|312|49|8|51|63)
RewriteRule ^(page\.as|index\.ph)p$ /content/123 [NC,R=301]
RewriteCond %{QUERY_STRING} id=7
RewriteRule ^index\.php$ /visa/work/usa/ref/1091 [NC,R=301]


__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
eastwood
Newbie
Newbie


Joined: 24 July 2007
Location: United Kingdom
Online Status: Offline
Posts: 5
Posted: 24 July 2008 at 3:18pm | IP Logged Quote eastwood

perfect

what about the

index.php?option=com_content&task=view&id=7&Itemid=7
maps to
/visa/work/usa/ref/1091

index.php
maps to
index.asp

store.asp
maps to
/content/store

index.php?option=com_content&task=view&id=49&Itemid=3&info=abc+123+Program
index.php?option=com_content&task=view&id=51&Itemid=3&info=abc+123+Program
index.php?option=com_content&task=view&id=63&Itemid=3&info=abc+123+Program

maps to
/content/123


Cheers


Back to Top View eastwood's Profile Search for other posts by eastwood
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 600
Posted: 25 July 2008 at 3:17am | IP Logged Quote Vyacheslav

Hi Jon.
Please try the following solution
Code:
RewriteCond %{QUERY_STRING} id=(9|312|49|8|51|63)
RewriteRule ^(page\.as|index\.ph)p$ /content/123 [NC,R=301]
RewriteCond %{QUERY_STRING} id=7
RewriteRule ^index\.php$ /visa/work/usa/ref/1091 [NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index\.php$ index.asp [NC,R=301]
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^store\.asp$ /content/store [NC,R=301]


__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 
eastwood
Newbie
Newbie


Joined: 24 July 2007
Location: United Kingdom
Online Status: Offline
Posts: 5
Posted: 25 July 2008 at 4:06am | IP Logged Quote eastwood

spot on once again, the only one I still cant get woring is this link:

index.php?option=com_content&task=view&id=99&Itemid=30

should map to

/visa/work/usa/ref/1095

using this rule:

RewriteCond %{QUERY_STRING} id=99
RewriteRule ^index\.php$ /visa/work/usa/ref/1095 [NC,R=301]

but I thinks its getting caught by this rule:

RewriteCond %{QUERY_STRING} id=(49|51|63)
RewriteRule ^(index\.ph)p$ /content/h1bvisa [NC,R=301]

because it goes to that page and not th eone I want


Heres my complete .htaccess file:


RewriteBase /
RewriteRule ^visa(?!\.asp)(.*)$ /page.asp$1 [NC]
RewriteRule ^popup(?!\.asp)(.*)$ /pop_up.asp$1 [NC]
RewriteRule ^content/([^.]*?)/?$ $1.asp
RewriteRule ^(.*?\.asp)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA]
RewriteRule ^[^?]+(/images/[^?/]+)$ $1 [NC,L]

RewriteCond %{QUERY_STRING} id=(9|312|49|8)
RewriteRule ^(page\.as)p$ /content/h1bvisa [NC,R=301]

RewriteCond %{QUERY_STRING} id=(49|51|63)
RewriteRule ^(index\.ph)p$ /content/h1bvisa [NC,R=301]

RewriteCond %{QUERY_STRING} id=(4|148)
RewriteRule ^(page\.as|index\.ph)p$ /content/store [NC,R=301]

RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index\.php$ index.asp [NC,R=301]

RewriteCond %{QUERY_STRING} id=7
RewriteRule ^index\.php$ /visa/work/usa/ref/1091 [NC,R=301]

RewriteCond %{QUERY_STRING} id=99
RewriteRule ^index\.php$ /visa/work/usa/ref/1095 [NC,R=301]

Back to Top View eastwood's Profile Search for other posts by eastwood
 
Vyacheslav
Moderator Group
Moderator Group


Joined: 02 July 2008
Location: Ukraine
Online Status: Offline
Posts: 600
Posted: 25 July 2008 at 4:59am | IP Logged Quote Vyacheslav

Hi Jon.
Please try the following solution (it's modified part of your config):
Code:
RewriteBase /                          
RewriteCond %{QUERY_STRING} id=(9|312|49|8)[^\d]*
RewriteRule ^page\.asp$ /content/h1bvisa [NC,R=301]

RewriteCond %{QUERY_STRING} id=(49|51|63)[^\d]*
RewriteRule ^index\.php$ /content/h1bvisa [NC,R=301]

RewriteCond %{QUERY_STRING} id=(4|148)[^\d]*
RewriteRule ^(page\.as|index\.ph)p$ /content/store [NC,R=301]

RewriteCond %{QUERY_STRING} ^$
RewriteRule ^index\.php$ index.asp [NC,R=301]

RewriteCond %{QUERY_STRING} id=7[^\d]*
RewriteRule ^index\.php$ /visa/work/usa/ref/1091 [NC,R=301]

RewriteCond %{QUERY_STRING} id=99[^\d]*
RewriteRule ^index\.php$ /visa/work/usa/ref/1095 [NC,R=301]


Also please describe, what you want from these rules (with examples, please):
Code:
RewriteRule ^visa(?!\.asp)(.*)$ /page.asp$1 [NC]
RewriteRule ^popup(?!\.asp)(.*)$ /pop_up.asp$1 [NC]
RewriteRule ^content/([^.]*?)/?$ $1.asp
RewriteRule ^(.*?\.asp)/([^/]*)/([^/]*)(/.+)? $1$4?$2=$3 [NC,LP,QSA]
RewriteRule ^[^?]+(/images/[^?/]+)$ $1 [NC,L]


__________________
Kind regards!
Vyacheslav Shinkarenko, HeliconTech.
Back to Top View Vyacheslav's Profile Search for other posts by Vyacheslav Visit Vyacheslav's Homepage
 

If you wish to post a reply to this topic you must first login
If you are not already registered you must first register

  Post ReplyPost New Topic
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum