0

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.

0

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).

  • The hosts file... yes, of course, I forgot all about the hosts file! But should the entry be 11.22.33.44/~abc example.org ? – Dan Mantyla Sep 2 '14 at 17:54
  • And it won't create duplicate content, it will create two urls that display the same content. For SEO concerns, it looks like to different pages, but that's not my concern. The few links will be corrected in the days after the migration, and the images shouldn't matter. I'm leaning back towards thinking that using a symlink and not the hostsfile is the answer. I would need HostGator to correct the hosts file, and that could be problematic. Now, if I had my own web server... – Dan Mantyla Sep 3 '14 at 17:30
  • Having the same content on two different URLs is the definition of duplicate content. But you are correct, the repercussions from it are minor, especially if it is only temporary and you are able to fix it with redirects later. – Stephen Ostermiller Sep 3 '14 at 17:32
  • The hosts file you would need to change is on your own computer, not on HostGator. The server's /etc/hosts file shouldn't need to be touched. – Stephen Ostermiller Sep 3 '14 at 17:33
  • ah, yes, the window's host file. let me think... /Windows/System32/drives/etc/hosts and open as Admin. Ok, now, MY computer will use the ip address when our live domain name is put into my browser, but.. hmmmmm.. would have to do this for everybody in the building during the "post stories to both sites" phase, and I've already put together another solution. However this may be the best answer. – Dan Mantyla Sep 16 '14 at 20:18
0

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).

  • how would you perform the search and replace? SQL and PHP? – Dan Mantyla Sep 3 '14 at 17:31
  • @DanMantyla Yes, you would perform an SQL query either via PHP, the command line tool, phpmyadmin, etc – Josh Mountain Sep 3 '14 at 18:02

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.