Mobile app version of vmapp.org
Login or Join
Candy875

: Can a soft link be used to fix URL problems? I'm developing a new website to replace our old website. The URL the dev site is 11.22.33.44/~abc/ (not that IP exactly) because that's what HostGator

@Candy875

Posted in: #Drupal #Url

I'm developing a new website to replace our old website. The URL the dev site is 11.22.33.44/~abc/ (not that IP exactly) because that's what HostGator gave me to use. Once complete, I'll change DNS servers so our domian name points to that server and not our old one.

I'm using Drupal and am taking great care to keep all links relative. However, because of the /~abc/ in the dev URL, it's not always possible to keep it relative and many links will break. Within the Drupal system or anywhere Drupal PHP is used, like for menus, it can figure out the URL on it's own. But for any images and links entered into the WYSIWYG, those will break.

Can a soft link fix this problem? Should I use the command ln -s /~abc /? Will the URL example.org/~abc/node/1 then show the page example.org/node/1 ?

I know this is not ideal for SEO, maintenance, and other reasons. But it would make the migration much smoother and quicker.

10.02% popularity Vote Up Vote Down


Login to follow query

More posts by @Candy875

2 Comments

Sorted by latest first Latest Oldest Best

 

@Heady270

Your soft link will create duplicate content. Every page on your site will have two URLs: one with ~abc and one without. It would solve your problem, but it would create potential problems for search engines. It isn't the best way to solve your problem.

For dev sites, I recommend using the hosts file on the machine from which you are doing your browser testing to point to your new server. You can add an entry like this:

11.22.33.44 example.org


That way you will see your new host when you visit your website at example.org. When you are done testing, you can make the change live for everybody using DNS (and remove it from your hosts file).

10% popularity Vote Up Vote Down


 

@Caterina187

I would recommend running a search and replace through your database for the old URL and replace it with the new URL when it is time to go live. This should update everything you need including your menus (assuming you haven't been hardcoding links into template files or something silly).

10% popularity Vote Up Vote Down


Back to top | Use Dark Theme