Jump to content

Htaccess And Stylesheet


hybrid kill3r
 Share

Recommended Posts

I just figured out how to use mod_rewrite. My htaccess code is the following:

Options +FollowSymlinksRewriteEngine onRewriteRule profile/([a-z]+)/([0-9]+) profile.php?action=$1&uid=$2RewriteRule forum/([0-9]+) threadlist.php?forumid=$1

I don't get any errors, but it won't display the stylesheet, even though I know the path it gets is correct because of the source code. I call the stylesheet with a php file using dirname(__FILE__) and it displays correctly and there is in fact a stylesheet at that specific path when I type it into my browser.BTW, not sure if this is HTML, but didn't know where else to put it. :)

Link to comment
Share on other sites

Try to create a link (an "a" element that is) leading to the same location (as written in your "link" element). Right click and select properties. Look at the "Address (URL)" field, and try to open THAT in your browser (you can select, copy and paste the value in there). It may turn out that the location you thought your path resolves to is different than the one the browser actually resolves it to.

Edited by boen_robot
Link to comment
Share on other sites

The link takes me to the same place, but it says the file isn't found. I am 100% positive that the URL is correct.
Could you give a link to the forum/site, and the supposed stylesheet? Also, where is the .htaccess located exactly? There could be a lot of places where relative paths could turn into a nightmare. Edited by boen_robot
Link to comment
Share on other sites

You should've followed everything I said...In

http://www.serverstrike.net/WarBoards/forum/2

looking at the source code shows

<link href='templates/default/style.css' rel=stylesheet />

If you create an achor to that, you'll have

<a href='templates/default/style.css'>CSS</a>

Right clicking on that should give you (and this is just a guess, based on what I'm able to do as a viewer):

http://www.serverstrike.net/WarBoards/forum/2/templates/default/style.css

Which I guess isn't where your CSS is located, right?If possible, try to give it an absolute path, as with your CSS at the main forum page:

<link href='http://serverstrike.net/WarBoards/templates/default/style.css' rel=stylesheet />

or (for the sake of portability; for the sake of lesses bandwidth; ideally):

<link href="/WarBoards/templates/default/style.css" rel="stylesheet" />

Link to comment
Share on other sites

  • 2 weeks later...

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...