D6 - what do I need to handle paths regardless of location within site

bitshift - January 8, 2009 - 14:30

Im developing my website locally, so I have a path below the root. Something like http://localhost:port#/mysitename

However, when I move this to my hosting account, into the root of the domain, the path will not include the site name and the root will be "/" instead of "/sitename". The content that Ive added so far, such as images and nodes appear to be using the sitename in the url path. Id like to be able to prepend the url of any content with [something-here]/node-alias-here, so that my urls work regardless if they are relative or not.

Will this do what I need ?
Paths filter ? http://drupal.org/project/pathfilter

Are you talking about

setfree - January 8, 2009 - 15:14

Are you talking about drupal-made paths or paths that you've created and hardcoded into your site.

If they are drupal made paths then I think everything should update automatically when you move your site (you can also manually change the the base URL in your settings config file).

If you are talking about hardcoded urls that you have made then you either have to change these manually or you can use a php spippet to prepend the base-url dynamically to your url.

<?php
global $base_url;

print
'<a href="$base_url' . '/yourpath">ANCHOR TEXT</a>';
?>

Turns out the alias that the

bitshift - January 12, 2009 - 20:40

Turns out the alias that the link was pointing to still had "content/" prepended to the front of it. Problem was a non-issue.
That still has me wondering if I understand url aliases correctly. If I define a node to have a specific alias, that node should be available in the root of the site, correct ? That is, regardless of if the site is on a domain name or running locally at a url of something like localhost:8080/site_name/alias_name

Yes, that is correct.

setfree - January 13, 2009 - 00:49

Yes, that is correct.

 
 

Drupal is a registered trademark of Dries Buytaert.