在Drupal7中使base_url相对

I need to make the base_url relative in Drupal 7. So it won't point to http://example.org/preview but to /preview.

How can I do that? Or how can I point the internal links all relative

//edit: I'm talking about all links in the finished html-source-code, what the browser gets to read.

Thanks :)

you can do it by using url() function which simply can be used as the following Example :

echo url('preview', array('absolute' => TRUE)) ; 

this example will link to http://example.com/preview

I don't know of an easy way to do this in one swoop, but usually I would use code like this:

$path = drupal_get_path('module', 'mymodule');
drupal_add_css($path . '/css/mymodulestyle.css', 'file');

I needed this because I was making a static copy of a site using httrack to run from a flash drive.

The only simple way of making links relative site-wide ( including css and js calls ) was to set

$base_url = '';

in setting.php