Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x support forum
 Helicon Tech : ISAPI_Rewrite 2.x support forum
Subject Topic: static url rewrite/redirect Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
zander
Newbie
Newbie


Joined: 12 May 2008
Online Status: Offline
Posts: 4
Posted: 14 May 2008 at 6:47pm | IP Logged Quote zander

I am trying to redirect this

/viewad.asp?id=50049574890100014

To a static url like this

/viewad/50049574890100014.asp

Any help would be appreciated, thanks in advance.

Back to Top View zander's Profile Search for other posts by zander
 
Yaroslav
Moderator Group
Moderator Group


Joined: 15 August 2002
Online Status: Offline
Posts: 6451
Posted: 16 May 2008 at 6:28am | IP Logged Quote Yaroslav

RewriteRule /viewad/(\w+)\.asp /viewad.asp\?id=$1 [I,L]

__________________
Yaroslav Govorunov,
Helicon Tech
Back to Top View Yaroslav's Profile Search for other posts by Yaroslav Visit Yaroslav's Homepage
 
zander
Newbie
Newbie


Joined: 12 May 2008
Online Status: Offline
Posts: 4
Posted: 16 May 2008 at 7:09am | IP Logged Quote zander

Hi Yaraslow

Thanks for that!

This works to rewrite the URL,  Could you please tell me how I make permanent 301 redirects.

So when a user clicks on:

/viewad.asp?id=50049574890100014

They automatically are redirected to this.

/viewad/50049574890100014.asp

Thanks again for your help, I don't find this easy.

Back to Top View zander's Profile Search for other posts by zander
 
zander
Newbie
Newbie


Joined: 12 May 2008
Online Status: Offline
Posts: 4
Posted: 16 May 2008 at 12:17pm | IP Logged Quote zander

Sorry, yaroslav, not yaraslow!
Back to Top View zander's Profile Search for other posts by zander
 
Lexey
Moderator Group
Moderator Group


Joined: 15 August 2002
Location: Russian Federation
Online Status: Offline
Posts: 7259
Posted: 16 May 2008 at 3:58pm | IP Logged Quote Lexey

RewriteCond Host: (.*)
RewriteCond %HTTPS (on)|.*
RewriteRule /viewad\.asp\?id=(\d+) http(?2s:)\://$1/viewad/$3.asp [I,RP]
Back to Top View Lexey's Profile Search for other posts by Lexey
 

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