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 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 2.x
Subject Topic: Read the current Page URL with ASP
Author
Message |
fitscorp
Newbie


Joined: 18 March 2009
Location: United Kingdom
Posts: 20
Posted: 16 November 2010 at 6:14am

Hi

Please help. My URLS are like:

www.site.com/category/product1.html

I want to read that URL in my page, obviously I tried Request.ServerVariables HTTP and URL but it just reads:

www.site.com/category.asp?productID=1

I am using this code

<%
Thispage ="http://" & Request.ServerVariables("SERVER_NAME") & Request.ServerVariables("URL") & "?" & Request.Querystring
%>

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 17 November 2010 at 3:54am

Firstly, please specify what version of ISAPI_Rewrite you are using - 2 or 3.
Then please show the config in use.
And explain which requests must be handled by it and in what way.

__________________
Regards,
Anton
Back to Top
 
fitscorp
Newbie


Joined: 18 March 2009
Location: United Kingdom
Posts: 20
Posted: 18 November 2010 at 2:24am

ISAPI Version 3
Windows IIS7

product-details.asp?ProductID=1&Category=90

That is the current config URL which reformats to

/home-fitness/treadmill_2.html

The rule we have:

#####################
RewriteCond %{QUERY_STRING} ^Category=189&ProductID=4542$ [NC]
RewriteRule ^/product-details\.asp$ /special-offers-clearance/boxing-sets/folding-boxing-set\.html? [NC,R=301,L]
RewriteRule ^/special-offers-clearance/boxing-sets/folding-boxing-set\.html$ /product-details\.asp\?Category=189&ProductID=4542 [NC,L]
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 18 November 2010 at 2:59am

"That is the current config URL which reformats to
/home-fitness/treadmill_2.html"
- not sure about it. There's no mention of "/home-fitness/treadmill_2.html" anywhere in the config...

Please tell what is it you want to achieve. Do you want to extend your config, or fix the existing rules?

__________________
Regards,
Anton
Back to Top
 
fitscorp
Newbie


Joined: 18 March 2009
Location: United Kingdom
Posts: 20
Posted: 18 November 2010 at 4:29am

The home fitness was an example.

Basically.. in my address bar the URL reads:

www.mysite.com/home-fitness/treadmill_2.html

If I use ASP to call the URL via Request.ServerVariables("SERVER_NAME")

It does not display the URL like
www.mysite.com/home-fitness/treadmill_2.html it shows

www.mysite.com/asp.asp?query=1&subquery=2

I want to display the ISAPI URL on an ASP page.. just read the URL exactly as it is .. and show it on the page...

Thanks for response

Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 22 November 2010 at 2:37am

Could you please enable logging in httpd.conf and provide rewrite.log records for the target request.
Also please attach the IIS log.

__________________
Regards,
Anton
Back to Top
 
fitscorp
Newbie


Joined: 18 March 2009
Location: United Kingdom
Posts: 20
Posted: 22 November 2010 at 3:00am

Thanks for getting back to me again, your support on these forums only make me want to praise your product more.

Sorry how do I do this?

Can you not just tell me how to read the URL? Do you understand what I want?

I just want a way for ASP to read the ISAPI URL and not the actual original file with parameters etc.. PHP can do this and so can Javascript via parent.window.href...
Back to Top
 
Anton
Admin Group


Joined: 30 January 2007
Location: Ukraine
Posts: 10519
Posted: 22 November 2010 at 3:56am

Maybe this quote from the docs will help you deal with the issue:

"Before any URL modification ISAPI_Rewrite saves original URL into the HTTP header named X-Rewrite-URL. Then it can be retrieved in script as
HTTP_X_REWRITE_URL server variable."

__________________
Regards,
Anton
Back to Top
 

Sorry, you can NOT post a reply.
This forum has been locked by a forum administrator.

Printable version Printable version
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