I'm new to drupal and php etc. I am redesigning an existing website (www.example.com) in drupal. The website is to stay at it's current location and with it's existing hosting provider until I have the redesign complete. I have a couple hundred pages in the form www.example.com/folder/page.aspx that will receive a new home in drupal and will need to be redirected. I have been trying to get 301 redirects to work -- I've read a number of different articles here -- and I must admit that I'm pretty confused and nothing I have tried has worked. I'm hoping someone might be able to walk me through this.

Here's where I'm at:

I recently signed up for a hosting service that will support drupal and multiple domains. I installed drupal under the master domain into the www directory.

The website that I'm redesigning will be added to this account as an add-on.

So to test that I'll be able to get it to work:

1. I added on a domain to this account: addon1.com.
2. I setup a database for this domain
3. Added it to the sites folder in drupal (www/sites/addon1.com)
4. created a symlink using php ( symlink("/home/username/public_html/", "/home/username/public_html/addon1"); ,
5. installed drupal.

Everything is working great and it looks like I'll have no problem adding on the site I'm redesigning and configuring it properly.

But once I transfer the existing site over, I need to make sure that any old pages in the form /folder/page.aspx get correctly redirected to their new pages in drupal. I don't think I have a full grasp of what's going on above which I think is adding to my confusion in setting this up.

I assume I will need to edit the .htaccess file (www/.htaccess). I have tried a few different things without success including:

RewriteBase /
#custom redirects

RewriteRule ^/folder/page.aspx http://addon.net/page [R=301,L]

#end custom redirects

Am I on the right track here? I'd greatly appreciate any suggestions or help.

Thanks,
Bryan

Comments

apothus’s picture

I also noticed that there is a .htaccess file located in sites/addon1.com folder that must have been created when I made the symlink.

SetHandler Drupal_Security_Do_Not_Remove_See_SA_2006_006
Options None
Options +FollowSymLinks

Is this the file where the redirects should go for this site?

Is it not possible to accomplish what I'd like to do here? Anybody?

andrewbenkard’s picture

http://drupal.org/project/path_redirect is the answer... No more .htaccess hacking.

I am posting this here since this thread is #1 for "301 multisite"