[support] how to handle internal links

Ray Zimmerman rz10 at cornell.edu
Tue Jul 4 19:22:07 UTC 2006


Unfortunately, the link you suggest would be broken on my dev server  
(drupal doesn't modify the link). It only works on a server that has  
drupal installed at the web server's document root.

I need something that converts "/node/99" to "/dev/node/99" on my dev  
server and "/node/99" on my production server, based on where my  
drupal install happens to be in the web server document root. Btw,  
menus do work properly no matter where the server is installed. A  
menu that points to node/99 will point to /dev/node/99 on my dev  
server and /node/99 on the production server. I'm just looking for a  
way to do that same translation for internal links embedded in content.

Isn't this an issue for lots of people? I find I'm always making  
copies of my site (throw my whole installation in a new directory and  
point it to a duplicate of the database) to play around with new  
features. Doesn't everyone do this?  :-)  How can I do it without it  
breaking all the internal links in my content?

	Ray
	

On Jul 4, 2006, at 2:17 PM, Laura Scott wrote:

> In Drupal 4.7, you would link to <a href="/node/99">now here I have  
> linked to node 99</a> (with the leading slash, which references the  
> root of the install, I believe).
>
> Laura
>
>
> On Jul 4, 2006, at 10:10 AM, Ray Zimmerman wrote:
>
>> I'm building a site that is currently in a sub-directory of my web  
>> server document root, but when it is finally deployed it will be  
>> in the document root. So currently node 99 is at, e.g.
>>
>>    http://example.com/dev/node/99
>>
>> ... but when I deploy the site it will be at ...
>>
>>    http://example.com/node/99
>>
>> My question is, what is the best way to link to node/99 from the  
>> body of another node, and have it work on my dev server as well as  
>> the production server? Is there an input filter that converts a  
>> URL that is relative to drupal's root into an absolute URL?
>>
>> 	Ray
>> -- 
>> [ Drupal support list | http://lists.drupal.org/ ]
>
> -- 
> [ Drupal support list | http://lists.drupal.org/ ]



More information about the support mailing list