This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 2.x
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Redirects and the address bar Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
JIHS
Newbie
Newbie


Joined: 26 February 2010
Online Status: Offline
Posts: 4
Posted: 26 February 2010 at 2:26pm | IP Logged Quote JIHS

I have only a small handful of URLs I am working with for SEO purposes, so won't be using regular expressions. I am just unfamiliar with how I need to setup a redirect.

I have a page called default.asp?q_areaprimaryid=13 and I want its address bar to look like newpagename.html

I have setup this rule, which works:
RewriteRule ^/newpagename\.html$ /default\.asp\?q_areaprimaryid=13

However, it only works if you go directly to newpagename.html in your browser. I want it to also work when you go to default.asp?q_areaprimaryid=13. And in both cases newpagename.html should appear as the URL in the address bar.

I know I'm missing the redirect piece, but the flags and whatnot are confusing to me.

Back to Top View JIHS's Profile Search for other posts by JIHS
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 01 March 2010 at 3:19am | IP Logged Quote Anton

You need the follwing rules to get redirect/rewrite working:

[ISAPI_Rewrite]

RewriteRule /newpagename\.html /default\.asp\?q_areaprimaryid=13 [I,L]
RewriteRule /default\.asp\?q_areaprimaryid=13 /newpagename\.html [I,RP]

__________________
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