views:

107

answers:

1

Normally I use

<base href="http://domain.com/" /><!--[if ie]></base><![endif]--> 

I haven't tried much with RewriteBase, I normally get confused and keep changing it till it works. Which method would be best, I obviously find the best solution because the links stay the same so that no links are broken most of the time when attaching a css file, e.g.

http://domain.com/css/main.css

It just always stay the same when accessing to sub-directories. Although, when I don't use the tag, and I access to a sub directory, it breaks the css links when I use

<link href="css/main.css" rel="stylesheet" type="text/css" />

As my PHP documents would include the header,

<?php include("include/global_header.php"); ?>

If I do that without the I would have to use:

<link href="../css/main.css" rel="stylesheet" type="text/css" />

Which can break when accessing to a sub-directory.

So... does the RewriteBase work the same as the ?

Your thoughts.

+1  A: 

Basehref works at the HTML level on rendering of the webpage

RewriteBase is in the .htaccess file which is processed by Apache before the HTML is rendered.

As a result they perform different functions and cannot be comapared

paullb