Active TopicsActive Topics  Display List of Forum MembersMemberlist  HelpHelp   RegisterRegister  LoginLogin
ISAPI_Rewrite 3.0 support forum
 Helicon Tech : ISAPI_Rewrite 3.0 support forum
Subject Topic: Affecting relative links, with css+images Post ReplyPost New Topic
Author
Message << Prev Topic | Next Topic >>
psyche
Newbie
Newbie


Joined: 05 March 2008
Online Status: Offline
Posts: 3
Posted: 05 March 2008 at 3:17am | IP Logged Quote psyche

Hi All

I can get the following to work, but as soon as I add a slash to the RewriteRule it affects the page's relative links like stylesheets and images:

The following works:
http://localhost/iPassion/Current/products

RewriteBase /iPassion/Current/
RewriteRule ^products$ body.php?getpage=ProductsView&categoryID=$1 [NC,L]


127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:32:09 GMT [localhost/sid#1][rid#7635668] init rewrite engine with requested uri /iPassion/Current/products
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:32:09 GMT [localhost/sid#1][rid#7635668] Htaccess process request D:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:32:09 GMT [localhost/sid#1][rid#7635668] applying pattern '^products$' to uri 'products'
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:32:09 GMT [localhost/sid#1][rid#7635668] Rewrite URL to >> /iPassion/Current/body.php?getpage=ProductsView&categoryID=
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:32:09 GMT [localhost/sid#1][rid#7635668] rewrite 'products' -> '/iPassion/Current/body.php?getpage=ProductsView&categoryID='
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:32:14 GMT [localhost/sid#1][rid#7635668] init rewrite engine with requested uri /iPassion/Current/templates/images/triangle.gif

--------------------------------------------------------------

Adding the slash doesn't work:
http://localhost/iPassion/Current/products/1

RewriteBase /iPassion/Current/
RewriteRule ^products/([0-9])$ body.php?getpage=ProductsView&categoryID=$1 [NC,L]


127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:00 GMT [localhost/sid#1][rid#7619748] init rewrite engine with requested uri /iPassion/Current/products/1
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:00 GMT [localhost/sid#1][rid#7619748] Htaccess process request D:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:00 GMT [localhost/sid#1][rid#7619748] applying pattern '^products/([0-9])$' to uri 'products/1'
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:00 GMT [localhost/sid#1][rid#7619748] Rewrite URL to >> /iPassion/Current/body.php?getpage=ProductsView&categoryID=1
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:00 GMT [localhost/sid#1][rid#7619748] rewrite 'products/1' -> '/iPassion/Current/body.php?getpage=ProductsView&categoryID=1'
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:06 GMT [localhost/sid#1][rid#7619748] init rewrite engine with requested uri /iPassion/Current/products/templates/style.css
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:06 GMT [localhost/sid#1][rid#7619748] Htaccess process request D:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:06 GMT [localhost/sid#1][rid#7619748] applying pattern '^products/([0-9])$' to uri 'products/templates/style.css'
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:06 GMT [localhost/sid#1][rid#7619748] init rewrite engine with requested uri /iPassion/Current/products/templates/Body/images/bg.jpg
127.0.0.1 127.0.0.1  Wed, 05-Mar-2008  08:29:06 GMT [localhost/sid#1][rid#7619748] Htaccess process request D:\Program Files\Helicon\ISAPI_Rewrite3\httpd.conf

-----------------------------------------------------------

I don't know why it's inserting a "products" directory to the page's relative links:
e.g.

<link rel="stylesheet" type="text/css" href="templates/style.css" />
<BODY BACKGROUND="templates/Body/images/bg.jpg">

Any Ideas? Spent 2 days with no luck so far, trying various combinations. 

Thanks
Psyche

 

 

 

 

Back to Top View psyche's Profile Search for other posts by psyche
 
Sergey
Moderator Group
Moderator Group


Joined: 11 March 2005
Online Status: Offline
Posts: 732
Posted: 05 March 2008 at 5:06am | IP Logged Quote Sergey

Please change page-relative links to either root-relative or absolute form.

<link rel="stylesheet" type="text/css" href="/templates/style.css" />
<BODY BACKGROUND="/templates/Body/images/bg.jpg">
Back to Top View Sergey's Profile Search for other posts by Sergey
 
psyche
Newbie
Newbie


Joined: 05 March 2008
Online Status: Offline
Posts: 3
Posted: 05 March 2008 at 4:48pm | IP Logged Quote psyche

Hi Sergey,

I tried the root-relative approach, but no go.
Then tried the absolute form and it works but worried abt showing the current directory for security. However, I modified it so it uses the host domain name instead. Thanks, after modifing the template parser all should be working. I managed to get the style sheet to work now. Now I just have to change the image src and background links :)

Thanks a heap
Psyche



Edited by psyche - 05 March 2008 at 4:49pm
Back to Top View psyche's Profile Search for other posts by psyche
 
Sergey
Moderator Group
Moderator Group


Joined: 11 March 2005
Online Status: Offline
Posts: 732
Posted: 06 March 2008 at 5:08am | IP Logged Quote Sergey

You can use <BASE> HTML tag to explicitly specify document base for document relative links.
Back to Top View Sergey's Profile Search for other posts by Sergey
 
psyche
Newbie
Newbie


Joined: 05 March 2008
Online Status: Offline
Posts: 3
Posted: 15 March 2008 at 9:23pm | IP Logged Quote psyche

Hi Sergey

Thanks again, i'll try that as well.

Thanks
Psyche
Back to Top View psyche's Profile Search for other posts by psyche
 

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 can vote in polls in this forum