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: Redirect old linkfreeze urls Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
scorche
Newbie
Newbie


Joined: 25 January 2007
Online Status: Offline
Posts: 17
Posted: 17 April 2008 at 2:31pm | IP Logged Quote scorche

I am currently using linkfreeze to rewrite urls using the hyphen to replace characters.  I have three urls that are rewritten they are:

http://www.thesite.biz/search1-zip-11111.html

is friendly for

http://www.thesite.biz/search1.aspx?zip=11111

http://www.thesite.biz/search2-zip-11111-subcat-111.html

is friendly for

http://www.thesite.biz/search2.aspx?zip=11111&subcat=111

AND http://www.thesite.biz/search3-zip-11111-heading-123.html

is friendly for

http://www.thesite.biz/search3.aspx?zip=11111&heading=123

I have written rules to use mapping files for each of these pages to provide keyword rich urls.  Thos rules are:

RewriteRule ^search1/([^/]+).html search1.aspx?zip=${zips:$1} [NC,L]

RewriteRule ^search2/([^/]+)/([^/]+).html search2.aspx?zip=${zips:$2}&subcat=${subcats:$1} [NC,L]

RewriteRule ^search3/([^/]+)/([^/]+)/([^/]+).html search3.aspx?zip=${zips:$3}&heading=${headers:$2} [NC,L]

And these rules work fine.  Now what I need to do is the following:

I want to turn linkfreeze off and there are many links on the internet that use the linkfreeze url.  When an old linkfreeze url is requested, I want it to be 301 redirected to the new keyword rich url.  How would I do this?

 

Back to Top View scorche's Profile Search for other posts by scorche
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4178
Posted: 18 April 2008 at 5:06am | IP Logged Quote Anton

Please try to use these rules:

RewriteCond %{QUERY_STRING} ^zip=(\d+)$ [NC]
RewriteRule ^search1\.aspx$ search1/%1.html? [NC,R=301,L]

RewriteCond %{QUERY_STRING} ^zip=(\d+)&subcat=(\d+)$ [NC]
RewriteRule ^search2\.aspx$ search2/%1/%2.html? [NC,R=301,L]

RewriteCond %{QUERY_STRING} ^zip=(\d+)&heading=(\d+)$ [NC]
RewriteRule ^search3\.aspx$ search3/%1/%2/%3.html? [NC,R=301,L]


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
scorche
Newbie
Newbie


Joined: 25 January 2007
Online Status: Offline
Posts: 17
Posted: 13 May 2008 at 1:43pm | IP Logged Quote scorche

This did not work.  How can I just redirect old linkfreeze urls to the new url format using mapfiles as described in the original post?
Back to Top View scorche's Profile Search for other posts by scorche
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4178
Posted: 14 May 2008 at 7:49am | IP Logged Quote Anton

Can you please provide some specific example of what you want to redirect and how.

__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
scorche
Newbie
Newbie


Joined: 25 January 2007
Online Status: Offline
Posts: 17
Posted: 14 May 2008 at 7:59am | IP Logged Quote scorche

I would like to redirect all links like this:

http://www.thesite.biz/search1-zip-11111.html

to this

http://www.thesite.biz/search1/city-state-zip.html

Where city-state-zip is looked up from a mapfile

Back to Top View scorche's Profile Search for other posts by scorche
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4178
Posted: 14 May 2008 at 8:45am | IP Logged Quote Anton

It should be smth like this:

RewriteRule ^search1-zip-([^/-]+)\.html search1/${mapfile:$1}.html [NC,R=301]


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
scorche
Newbie
Newbie


Joined: 25 January 2007
Online Status: Offline
Posts: 17
Posted: 15 May 2008 at 6:30am | IP Logged Quote scorche

This worked somewhat but the value from the mapfile is not displayed.  When I go to a url that is redirected to the rewritten one, I am redirected to search1/.html  no value where the mapfile value should be.
Back to Top View scorche's Profile Search for other posts by scorche
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4178
Posted: 15 May 2008 at 8:51am | IP Logged Quote Anton

Your map file should look like this:
mapfile.txt:
11111 city-state-zip
etc.

Please provide the config you are using and rewrite log records for the specific non-working request.


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 
scorche
Newbie
Newbie


Joined: 25 January 2007
Online Status: Offline
Posts: 17
Posted: 15 May 2008 at 9:00am | IP Logged Quote scorche

my map file is reversed from your example, but that is so that it works with my other rules. 

my full config is here:

# Helicon ISAPI_Rewrite configuration file

# Version 3.0.0.29

RewriteLog "C:\Program Files\Helicon\ISAPI_Rewrite3\newrewrite.log"

ErrorLog "C:\Program Files\Helicon\ISAPI_Rewrite3\newerror.log"

RewriteLogLevel 9

LogLevel debug

RewriteEngine on

RewriteBase /

RewriteMap zips txt:mapfiles/zipmap.txt

RewriteMap cats txt:mapfiles/catmap.txt

RewriteMap subcats txt:mapfiles/subcatmap.txt

RewriteMap headers txt:mapfiles/headermap.txt

RewriteMap clients txt:mapfiles/clientmap.txt

#search1 rule

RewriteRule ^search1/([^/]+).html search1.aspx?zip=${zips:$1} [NC,L]

#search2 rule

RewriteRule ^search2/([^/]+)/([^/]+).html search2.aspx?zip=${zips:$2}&subcategoryid=${subcats:$1} [NC,L]

#search3 rule

RewriteRule ^search3/([^/]+)/([^/]+).html search3.aspx?zip=${zips:$2}&header=${headers:$1} [NC,L]

#the below rule will be used for the dynamic client page

RewriteRule ^companies/([^/]+)/([^/]+)/([^/]+).html companies/website.aspx?client_id=${clients:$1}&zip=${zips:$2}&header=${headers:$3} [NC,L]

#These rules are for alod link style redirects

#RewriteCond %{QUERY_STRING} ^zip=(\d+)$ [NC]

#RewriteRule ^search1\.aspx$ search1/%1.html? [NC,R=301,L]

#

#RewriteCond %{QUERY_STRING} ^zip=(\d+)&subcat=(\d+)$ [NC]

#RewriteRule ^search2\.aspx$ search2/%1/%2.html? [NC,R=301,L]

#

#RewriteCond %{QUERY_STRING} ^zip=(\d+)&heading=(\d+)$ [NC]

#RewriteRule ^search3\.aspx$ search3/%1/%2/%3.html? [NC,R=301,L]

RewriteRule ^search1-zip-([^/]+)\.html search1/${zips:$1}.html [NC,R=301]

#RewriteRule ^search1-zip-([^/]+)\.html search1.aspx?zip=${zips:$1} [NC,R=301]

 

Log File

Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] init rewrite engine with requested uri /search1/19380.html
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] Htaccess process request C:\Inetpub\new.bythezip.com\.htaccess
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] applying pattern '^search1/([^/]+).html' to uri 'search1/19380.html'
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] escaping /search1.aspx?zip=
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] Rewrite URL to >> /search1.aspx?zip=
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] rewrite 'search1/19380.html' -> '/search1.aspx?zip='
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] init rewrite engine with requested uri /index.aspx
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] Htaccess process request C:\Inetpub\new.bythezip.com\.htaccess
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] applying pattern '^search1/([^/]+).html' to uri 'index.aspx'
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] applying pattern '^search2/([^/]+)/([^/]+).html' to uri 'index.aspx'
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] applying pattern '^search3/([^/]+)/([^/]+).html' to uri 'index.aspx'
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] applying pattern '^companies/([^/]+)/([^/]+)/([^/]+).html' to uri 'index.aspx'
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] applying pattern '^search1\.aspx$' to uri 'index.aspx'
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] applying pattern '^search2\.aspx$' to uri 'index.aspx'
Mon, 12-May-2008  15:40:52 GMT [btz.dyndns.biz/sid#864830077][rid#19734760] applying pattern '^search3\.aspx$' to uri 'index.aspx'
Mon, 12-May-2008  15:42:04 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] init rewrite engine with requested uri /search1-Zip-19508.html
Mon, 12-May-2008  15:42:04 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] Htaccess process request C:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
Mon, 12-May-2008  15:42:04 GMT [btz.dyndns.biz/sid#864830077][rid#19734464] Htaccess process request C:\Inetpub\new.bythezip.com\.htaccess



Edited by scorche - 15 May 2008 at 9:03am
Back to Top View scorche's Profile Search for other posts by scorche
 
Anton
Moderator Group
Moderator Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 4178
Posted: 16 May 2008 at 3:42am | IP Logged Quote Anton

To redirect this: http://www.thesite.biz/search1-zip-11111.html to this http://www.thesite.biz/search1/city-state-zip.html,you need to have map files in the format I provided (aside with the ones you already have).


__________________
Regards,
Anton
Back to Top View Anton's Profile Search for other posts by Anton
 

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