This forum has been moved here:
Helicon Tech Community Forum

ISAPI_Rewrite 3.0 (Forum Locked Forum Locked)
 Helicon Tech : ISAPI_Rewrite 3.0
Subject Topic: Rewrite resulting in wrong root path
Author
Message |
robzero
Newbie


Joined: 05 October 2011
Posts: 1
Posted: 05 October 2011 at 4:21pm

Hi

I have some code that i thought was going to be simple but isn't working out that way.

The code simply is

RewriteRule JobInformation/([0-9]+)/([_0-9a-z-]+) JobInformation.asp?JobId=$1

http://mydomain.com/JobInformation/12345/Jobinformation-Title-Etc
should map to
http://mydomain.com/JobInformation.asp?JobId=12345

which it does but with one side affect

all of the urls on the resulting page now are constructed as

http://mydomain.com/JobInformation/12345/example.asp

instead of

http://mydomain.com/example.asp


So all references to CSS, JS and links to other pages on the resulting page break.

I have tried with RewriteBase present etc.  I have other rewrites for simple url mapping working fine.... such as

RewriteRule interview\-tips$ interview-tips.asp

That works and takes mydomain.com/interview-tips to mydomain.com/interview-tips.asp

Please help as I've spent literally evenings on this now and am tearing my hair out.

UPDATE...

Figured it out...slightly annoying.  Big find and replaced job across the site to make all standard links like href="blah" become href="\blah", including image references in css etc.

If anyone else has any other solutions then great but for me i fixed it myself with a bit of experimentation.

The other thing i found out is you can't have UPPERCASE letters in the url otherwise it breaks. well it does at my host anyway. 




Edited by robzero - 05 October 2011 at 5:46pm
Back to Top
 
Guests
Guest


Joined: 01 October 2003
Online Status: Online
Posts: -160
Posted: 07 October 2011 at 3:12am

Hello,

There's no alternative to having all links to CSS or JPG in absolute or root-relative format. It just has to be this way.

To make your rule work in both lower- and upper-case format, please, add [NC]-flag, to make rule case-non-sensitive.

Regards
Andrew
Back to Top
 

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

Printable version Printable version