? I always send all my requests to PHP via mod_rewrite and trace using PHP. So all my links are absolute, i.e. /...">

Should we use <base href = "/">?

I always send all my requests to PHP via mod_rewrite and trace using PHP. So all my links are absolute, i.e. /about/something.

I usually write my links like this ...

<a href="<?php echo BASE; ?>">home</a>

Where BASEusually translates to /or may vary depending on the base URL.

I remember giving <base href="<?php echo BASE; ?>" />before, but I can’t remember why I stopped using it (I think it gave me headaches).

Are there any problems using this item?

+5
source share
3 answers

href HTML 4.01 URI. . http://www.w3.org/TR/html4/struct/links.html#h-12.4.

, , , , <base href="/">, , -.

+3

base href ; mod_rewrite, url , URL- . href . .

+3

OpenCart uses it, Magento 1.7+ - no, Drupal 6 - no. In the past, I came across one href user base, and it seems to simplify the maintenance of the project, but this is just my opinion.

0
source

All Articles