Project

General

Profile

PlugIn for Domain/SubDomain Redirection

Added by Karl Heinz Marbaise about 15 years ago

Hi,
I would like to know if a plugin could handle the situaiton to go to a particular project part based on the calling URL...

e.g. www.xz.org => project xyz (particular page e.g. wiki)
www.abc.org go to project abc may be different page...
or a scenario: xyz.example.com, abc.example.com ...

Such a plugin should store this as a supplemental information for the project.

Is it possible to enhance the e.g. project table with such information ?

Kind regards
Karl Heinz Marbaise


Replies (2)

RE: PlugIn for Domain/SubDomain Redirection - Added by Brad Beattie about 15 years ago

Yes, it's possible to do, but it doesn't involve Redmine at all. Consider the generalized form:

something.example.com goes to www.example.com/somepage

RE: PlugIn for Domain/SubDomain Redirection - Added by Karl Heinz Marbaise about 15 years ago

Hi,
i've tried the following simple test...but with the result that is does not work...

class ApplicationController < ActionController::Base
  before_filter :user_setup, :check_if_login_required, :set_localization, :choose_route

def choose_route
    url = request.host
    # don't make a different with or without the www
    url = url.gsub(/www\./, "")
    case url
      when 'xyz.de'
       redirect_to :controller => "projects", :action => "show", :id => "supose" 
     else
       # No default     
    end
 end

Any suggestions ...

Kind regards
Karl Heinz Marbaise

    (1-2/2)