Closed Thread Icon

Preserved Topic: mod_rewrite problem (Page 1 of 1) Pages that link to <a href="http://ozoneasylum.com/backlink?for=21071" title="Pages that link to Preserved Topic: mod_rewrite problem (Page 1 of 1)" rel="nofollow" >Preserved Topic: mod_rewrite problem <span class="small">(Page 1 of 1)</span>\

 
Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

posted posted 12-12-2003 22:19

Been trying to get mod_rewrite to work on my new page. Got most of it working as I want it to, urls like www.golden-ratio.net/vim gets rewritten to www.golden-ratio.net/index.php?vim as I want it to. But when I try to rewrite www.golden-ratio.net/vim/ to the same adress as previously the page loads, but the style sheet is not loaded. When I add the [R] thing to the end of the RewriteRule to see what the difference in the url is, both of them end up working. Which is kind of nice, except that I want the pages to be "redirected" without the user noticing it...

The RewriteRules that I use look like this:

code:
RewriteRule		vim/?$ /index.php\?vim  [R]

RewriteRule archive/([0-9]+)/?$ /index.php\?archive\:$1 [R]



I've also got the same problem when trying to use above rule for the archive/... Works like a charm with the [R] option there, but when I remove it the stylesheets aren't shown.

Any one had this problem before, or know a way to fix it?

_________________________
"There are 10 kinds of people; those who know binary, those who don't and those who start counting at zero"
- the Golden Ratio -

Emperor
Maniac (V) Mad Scientist with Finglongers

From: Cell 53, East Wing
Insane since: Jul 2001

posted posted 12-12-2003 23:19

Veneficuz: Yep I had this problem before and the answer is to make your links absolute to the root so:

<link rel="stylesheet" type="text/css" media="screen" title="red" href="./style/01.css" />

becomes:

<link rel="stylesheet" type="text/css" media="screen" title="red" href="/style/01.css" />

The problem occurs because the browser thinks you are in the 'vim' directory and so looks for the file realtive to that. If you use friendly URLs then you need to use absolute (not relative) links.

___________________
Emps

The Emperor dot org

Veneficuz
Paranoid (IV) Inmate

From: A graveyard of dreams
Insane since: Mar 2001

posted posted 12-12-2003 23:56

That fixed it! Thanks a lot



_________________________
"There are 10 kinds of people; those who know binary, those who don't and those who start counting at zero"
- the Golden Ratio -

« BackwardsOnwards »

Show Forum Drop Down Menu