Forum Moderators: phranque

Message Too Old, No Replies

weird (to me) little problem

loosing relative position

         

protec

1:35 pm on Sep 7, 2010 (gmt 0)

10+ Year Member



I am trying to use the following lines in my htaccess file:

#RewriteRule ^([^.]+)/(.*)$ /index.php?page=$1&extra=$2 [L]
RewriteRule ^([^.]+)/?$ /index.php?page=$1 [L]

The second line does exactly what needs to be done. The first one, as soon as I uncomment it, ruins all relative info on my website.

I do not want anything difficult. Just want to use friendly url's to pass some info which I can then use to include stuff.

The "level" where I am browsing at, should not ever be deeper than root level.

I hope this makes some sense. Not very good in explaining this I think.

g1smd

6:05 pm on Sep 7, 2010 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The links to your images, stylesheets and scripts must begin with either a leading slash or with the protocol and domain name.

It is the browser that resolves the URLs from links, based on the URL of the currently viewed page. Those links must NOT contain relative links.

protec

6:38 pm on Sep 7, 2010 (gmt 0)

10+ Year Member



Yes, of course. I understand. The browser doesn't give a sh. about the redirect. it "thinks" it's a directory further in.
Makes sense.

Thanks,

M