subdomain redirect

fellow - May 1, 2008 - 18:00
Project:Path redirect
Version:6.x-1.0-beta6
Component:Code
Category:feature request
Priority:normal
Assigned:Unassigned
Status:needs review
Issue tags:domain access
Description

Hi,

I use Domain Access module and want to redirect subdomain1.example.com/a1 to subdomain2.example.com/a2, what should I do? at path_redirect/new only Drupal path or path alias is allowed. If I try "from a1 to subdomain2.example.com/a2" , it redirects me from example.com/a1 not from subdomain1.example.com... Thanks!

#1

Dave Reid - January 28, 2009 - 01:49
Status:active» postponed (maintainer needs more info)

Can you please try on the latest 5.x-1.x version of the module?

#2

nirvanajyothi - July 1, 2009 - 16:34

You can do this by adding the redirect from the from the subdomain from where you wish to redirect. ie., subdomain/admin/build/path-redirect/add (instead of from example.com/admin/build/path-redirect/add)

#3

leenwebb - October 23, 2009 - 14:22
Version:5.x-1.1» 6.x-1.0-beta4

I added a redirect from abc.mysite.com/specialURL (a subdomain) but the redirect is applying to www.mysite.com/specialURL (the main domain) as well. Is there any way to have the redirect ONLY apply to the subdomain URL?

#4

jackinloadup - October 23, 2009 - 20:53

My need is slightly different then what is originally posted on this issue. I want to redirect users from devsite1.mysite.com to somesite.com

The patch below will make any of these options

devsite1.mysite.com
devsite1.mysite.com/node/*
devsite1.mysite.com/anything

and redirects it to

somesite.com

We wanted to make it so when we moved out development site live and clients who didn't update their bookmarks would get directed to the correct website.

how it works:
when adding a redirect the from field needs to be the whole subdomain path including http:// like so
http://devsite1.mysite.com/
then in the To field put the forward address like normal
http://somesite.com/

AttachmentSize
253612-subdomain_redirect.patch 1.28 KB

#5

Dave Reid - December 2, 2009 - 07:15
Status:postponed (maintainer needs more info)» needs work
Issue tags:+domain access

#6

marcvangend - December 4, 2009 - 11:33
Version:6.x-1.0-beta4» 6.x-1.0-beta6
Category:support request» feature request
Status:needs work» needs review

Hi,

Here is a patch against Path Redirect 6.x-1.0-beta6 that allows integration with domain module. I have tried to make it as clean as possible, but there may well be room for improvement - consider it a starting point. Without this patch, path redirect does work together with domain access, but every redirect works on all domains and always stays on the same domain.

This patch:
- redirects from a certain domain to another domain
- adds two columns in the database to store source domain and redirect domain (updated schema and update function are included in the patch)
- adds two domain select fields on admin/build/path-redirect/add
- adds a checkbox to the settings page to enable per-domain redirection
- shows the from and to domains in the redirects list
- of course checks if domain.module is installed

I'm looking forward to your reviews.

By the way:
I also fixed a small typo in this patch:

-        $conditions[$field] = "$field = " . dB_type_placeholder($type);
+        $conditions[$field] = "$field = " . db_type_placeholder($type);

AttachmentSize
path_redirect_domain.patch 8.02 KB
 
 

Drupal is a registered trademark of Dries Buytaert.