1 Replies - 2856 Views - Last Post: 04 August 2009 - 05:26 AM

#1 k0b13r  Icon User is offline

  • D.I.C Head
  • member icon

Reputation: 15
  • View blog
  • Posts: 243
  • Joined: 18-July 06

Mod_rewrite and CSS files

Posted 29 July 2009 - 10:31 AM

Hi. I have a little problem with URL rewriting :/. I'm linking CSS files to site and my path to file is like "css/style.css". And I rewrite URLs with mod_rewrite. I get address like something.com/page/ but my my CSS file isn't linked ...
I also tried "/css/style.css", but it's not working too ...
How can I prevent it ? Thanks for answers.

This post has been edited by k0b13r: 29 July 2009 - 10:36 AM


Is This A Good Question/Topic? 0
  • +

Replies To: Mod_rewrite and CSS files

#2 didgy58  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 246
  • Joined: 23-October 07

Re: Mod_rewrite and CSS files

Posted 04 August 2009 - 05:26 AM

when using mod rewrite i tend to define a variable usually called SITE_LOCATION in my config file that i would then use in all links, this variable would containg the absolute path to the site i.e. http://127.0.0.1/websiteimworkingon/

and then i would simply

<link rel='stylesheet' type='text/css' href='<?=SITE_LOCATION?>css/styles.css" />




hope this helps
Was This Post Helpful? 0
  • +
  • -

Page 1 of 1