Base url

Hi there,

I’ve had a search through this forum, and I’m sure this question’s been asked before, but I can’t seem to find a satisfactory answer.

I’m testing out a site here:

Now in my HTML I have links like this <img src=“/images/blahblah.jpg”>, which ain’t workin, cos the server is looking in, not

So I’ve tried using <base href=“”> in the head, but no joy.

I’ve also added a .htaccess file to /luxe/ and added the command:
DocumentRoot /path/to/public_html/luxe/

and I get a 500 Internal Server Error.

I’ve also tried
RewriteEngine on
RewriteBase /luxe/

no good.

Does anyone have any idea where I’m going wrong?


Ok, so after a bit of playing around, I realised that the trailing slash was messing me around.

The base href has a trailing slash on it http://mikes-lab/luxe[B]/[/B]
The links in my html were like so /css/styles.css, which was pointing to the root directory, I tool the leading slashes out and now everything works… except one thing. References in my stlye sheets aren’t loading. They are relative (…/images/image1.jpg), and don’t want to play with me.


Your supplied link to Mikes-Lab/luxe is missing .com

For your stylesheet try this:

<link rel="stylesheet" href="../css/styles.css">

With a little bit of luck your stylesheet image references should be correct :slight_smile:

Hi John_Betong,

Thanks for your reply.

Yeah, my bad about the .com, that was a typo.

<link rel=“stylesheet” href=“…/css/styles.css”>
references the stylesheet at, rather than

I’ll keep digging.


Just realised I hadn’t uploaded the images!

Feel like an absolute noob.

Ok, so just to clarify, if anyone comes a-looking at this post in the future, I’ve set up the head like so:

  <base href="">
  <link rel="stylesheet" src="css/styles.css">

and everything works a charm.