Welcome to WebmasterWorld Guest from 107.21.183.163

Forum Moderators: ergophobe

Message Too Old, No Replies

Moving a site to folder in another site

     

rag_gupta

5:28 am on Feb 25, 2014 (gmt 0)



I've a site www.example.com which I want to move to existing site so that it'd look like : www.existingsite.com/example/


So www.example.com/about.htm will look like www.existingsite.com/example/about.htm


I can't seem to find proper procedure to do it. Mine is Drupal site.

What is the right way?

GoNC

12:06 am on Mar 3, 2014 (gmt 0)



It depends on the server that the existing site is on. If it allows you to park a domain on a subdirectory, then create:

example.existingsite.com

Then park example.com on it.

The only other way I know to do this requires that you keep a hosting account for example.com, then use .htaccess to redirect everything. Something like:

RewriteEngine on
RewriteRule ^(.*)$ http://www.existingsite.com/example/$1 [R=301,QSA,L]

(That's not tested, I just typed it for this example, so beware any typos)

[edited by: phranque at 7:35 am (utc) on Mar 3, 2014]
[edit reason] unlinked url [/edit]

rag_gupta

3:46 am on Mar 3, 2014 (gmt 0)



I don't want to use 301 or redirects. I will directly copy the contents of my site into www.existingsite.com/example. Only that this example.com is Drupal based dynamic site with it's own .htaccess

GoNC

4:03 am on Mar 3, 2014 (gmt 0)



If you mean that existingsite.com/example will dynamically show the same thing as example.com at all times, then the best option is to park the example.com domain on top of example.existingsite.com.

If that doesn't work, and you don't want to use 301, you could always use .htaccess to proxy the new site, if the server allows it. I haven't done this in a LONG time, but I think it's:

RewriteEngine on
RewriteRule ^(.*)$ http:_www_existingsite_com/example/$1 [P,QSA,L]

Note that this forum changed the link in my example to [existingsite.com], not me. I replaced the // and . with _ to make it format properly.

If you need something else that's more specific to Drupal, sorry, but that's not my expertise. I have very little experience with template programs.

lucy24

8:05 am on Mar 3, 2014 (gmt 0)

WebmasterWorld Senior Member lucy24 is a WebmasterWorld Top Contributor of All Time Top Contributors Of The Month



I've a site www.example.com which I want to move to existing site so that it'd look like : www.existingsite.com/example/

What, exactly, do you mean by "look like"? This is important.

(a) you're moving the site to a different physical directory, but you want it to keep the old URLs
(b) you're changing all URLs of the old site to a new form, whether or not you're physically moving any files

rag_gupta

8:22 am on Mar 3, 2014 (gmt 0)



Lucy moving means not at all redirecting( using 301 or so). I simply want to place a new Drupal based site within www.existingsite.com/example where www.existingsite.com is already a Joomla site. So the example folder will contain Drupal's .htaccess file plus it's own index.php and other usual stuff.

ergophobe

7:52 pm on Mar 3, 2014 (gmt 0)

WebmasterWorld Administrator ergophobe is a WebmasterWorld Top Contributor of All Time 10+ Year Member Top Contributors Of The Month



There's no real problem with that. The only thing is that both Joomla and Drupal work by rewriting all requests that are not to a file or directory so that they call the index.php file in site root.

So the only thing you really have to do is
- Install drupal in the /example directory
- set up your Joomla .htaccess so that it doesn't rewrite any requests to the /example/.* or /example$

The second bit is important, otherwise if you have a Drupal URL alias like

www.existingsite.com/example/my-page

Since it is not a file or directory, Joomla will try to serve that page if you don't do step two.

By the way - if you can migrate data, it might be worth it. It's enough hassle to maintain one CMS. Maintaining two is just that much more work. If I could, I'd import one into the other.