This forum has been moved here:
Helicon Tech Community Forum

  Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
Common Questions
 Helicon Tech : Common Questions
Subject Topic: how to prevent request page without param Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
toologic
Newbie
Newbie


Joined: 12 September 2008
Location: Russian Federation
Online Status: Offline
Posts: 15
Posted: 01 December 2011 at 4:27am | IP Logged Quote toologic

Hello!

I have a page that should be called only with parameters. For example:

instead of page.aspx must call page.aspx?id=0

How i can do it?

p.s. isapi_rewrite 3.0

Back to Top View toologic's Profile Search for other posts by toologic Visit toologic's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 01 December 2011 at 11:06am | IP Logged Quote Anton

So, do you want to add a parameter when it's absent or do you want to block pages without parameters?

Please try

RewriteBase /
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^page\.aspx$ /page.aspx\?id=0 [NC,L]

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


Joined: 12 September 2008
Location: Russian Federation
Online Status: Offline
Posts: 15
Posted: 01 December 2011 at 12:01pm | IP Logged Quote toologic

Anton, thanks

I want to add a parameter when it's absent.

And and another question. How can I limit call the page with only a specific range of IP, and all other redirect to another page, for example 403.aspx  - access denied?

Back to Top View toologic's Profile Search for other posts by toologic Visit toologic's Homepage
 
Anton
Admin Group
Admin Group


Joined: 30 January 2007
Location: Ukraine
Online Status: Offline
Posts: 10520
Posted: 02 December 2011 at 4:54am | IP Logged Quote Anton

To add the query sting please try the code I've given above:

RewriteBase /
RewriteCond %{QUERY_STRING} ^$
RewriteRule ^page\.aspx$ /page.aspx\?id=0 [NC,L]

As for IP ranges, try this structure (it may require a tricky regular expression to specify the range but it's achievable):

RewriteCond %{REMOTE_ADDR} !^203\.20\.15\.10$
RewriteRule .? /403.aspx [R=301,L]

__________________
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