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!

Support from Acquia helps fund testing for Drupal Acquia logo

Comments

Dave Reid’s picture

Status: Active » Postponed (maintainer needs more info)

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

nirvanajyothi’s picture

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)

leenwebb’s picture

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?

Jackinloadup’s picture

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/

Dave Reid’s picture

Status: Postponed (maintainer needs more info) » Needs work
Issue tags: +domain access
marcvangend’s picture

Version: 6.x-1.0-beta4 » 6.x-1.0-beta6
Category: support » feature
Status: Needs work » Needs review
FileSize
8.02 KB

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);
nirvanajyothi’s picture

Thanks very much for this function. Will be useful to rising Domain Access users.

Dave Reid’s picture

Version: 6.x-1.0-beta6 » 6.x-1.x-dev
Status: Needs review » Needs work
ionmedia’s picture

hello, is where any way for redirect from subdomain/absolute url ?

marcvangend’s picture

ionmedia, this topic is not a help forum, it's the place where we discuss changes to the Path Redirect module in order to make it work together with the Domain Access module. If you need help with the path redirect module, please open a support request issue. If you need general help, open a new forum topic.