Hello All;
I know that this must be a simple thing, but I could use some help. I have one Drupal Install folder with multiple sites already installed via inside the "sites" folder.
Now, for EACH of those multiple sites, I need to have each of the .com, the .org, .net, etc. extension version of the domain point to its own respective site.com folder and site files.
My set up on shared host;
Folder hierarchy;
public_html > drupal_base_install > sites >
site1.com folder
site2.com folder
site3.com folder
Each site has its own DB, a "settings.php" file and a "files" folder within each site folder. Now I want to ADD the domains site1.org & site1.net so that they resolve directly to the site1.com folder and so that they access the same DB and "files" folder.
Same with site2.com, site3.com, etc. so that each domain extension (.org, .net, etc.) resolves to the .com folder of each domain. Simple, right? I tried using folders named simply site1, site2, etc. within my sites folder, but this does not work.
What is the EASIEST way without creating symlinks or getting too technical?
Thanks for any assistance that anyone can provide~!
Comments
.htaccess redirect .org & .net
Perhaps not exactly what your asking for but i'd consider forwarding all traffic from .net & .org to the .com. This will allow users to access the right site and avoid duplicate content appearing across search engines.
You could achieve this from your .htaccess file.
http://enarion.net/web/apache/htaccess/redirect-www-and-no-www/
Redirect of domains through .htaccess for Drupal ?
Hi;
Thanks so much for the quick response to my query. As you noted, I'm not sure that this is exactly what I need, but if it works, then why not. (Though I do want easy and simple after all!)
I am a little unclear (even after going to the link page and reading) precisely where this .htaccess file should be located. Am I to edit the .htaccess in my main html folder, the Drupal base install folder, place a .htaccess file in the site1.com folder (re; my examples above) or., where?
I obviously want all of my domains to work properly and I will be having perhaps 10 or maybe 20 or more domains using this one single Drupal install. When I say domains, I mean site1.com, site2.com, etc., AND their related .org, .net, etc. domain extensions.
I only need the various extensions to resolve to their related .com folders., ie. site1.com site1.org and site1.net resolve to the site1.com folder and on and on for each successive domain (site2.com, .org. net, etc.). This should seem to be logical and easy for Drupal?
The less that I have to do to make this work the better. If I have to place a .htaccess file within each site folder, that seems fine. OR, if I have to make a global .htaccess file for ALL of my domains and then edit that file as I add more domains, that seems OK too, I guess.
Soo., clarification. Where do I place this .htaccess file (I already have the files) and does there need to be one for each domain or edit one global file for all domains? I guess the placement of the .htaccess file will determine this, yes?
I don't know that redirects are the best way to do this. I would have thought that there was something wihin the Drupal install what would allow multiple domains to resolve to one folder, especially if the only difference between domains is the extension.
Thanks so much again.
AK
Global .htaccess file
It is the global .htaccess file you'll want to use. you want to edit it not replace it as Drupal 6 has already got functionality in it. It sounds like this solution will be meet your needs.
_
To redirect a .net domain to . .com, add this to your .htaccess (changing the 'example', natch)
.htaccess editing for Drupal domain redirect
Hi;
Thanks for the quick info. Where does this .htaccess file reside? I have .htaccess files all over the place. Global public_html folder, base Drupal install folder, and then each successive site1.com, stie2.com folders in my sites folder.
Which .htaccess file gets edited and where does it need to go in order to resolve a particualr domain? Do I need a file for each domain or is one global .htaccess file OK and if so, where do I place it?
Thanks again;
AK
what could be easier
what could be easier than symlinks? :-B
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Is symlinks really the easy answer?
Hi;
I'm not sure as I have never set up or used symlinks. If it can be explained in a one or two sentence instruction, then perhaps it is easy.
If it is a page of multiple steps for each domain and needs to have access to the shared host, then this does not seem easy to me.
I'm on a shared host (read: cheap) and have minimal access to my public_html folder but no access to any other server files (that I know of).
I am also not all that technical and still a relative newbie with Drupal, thus the request for simple and easy. My last look into symlinks did not seem easy.
If you can make it simple and easy, I would really appreciate it. Thanks~!
AK
one line.
On the server, you type
ln -s example.com example.netand now requests for example.net will work, and be served from the example.com folder transparently.
Done.
If, as you say, you are unable to type a line into the commandline at all, then there are ways around it, but they require more than one step.
either
or
exec();If those steps are too hard, I can't make any more suggestions, other than contact a web developer who can do it for you.
.dan. is the New Zealand Drupal Developer working on Government Web Standards
Will this work for sub-domains? Where to enter command?
Will this work for sub domains also?
I have Drupal in football.test.com and I want football.test2.com to also poin to football.test.com.
Do I have to CD into a certain directory to run that command?
ln -s football.test.com football.test2.com ?
thanks
Not sure if I understand your
Not sure if I understand your question.
If you are trying to have http://example.org and http://example.net all point to http://example.com why not just park the .org and .net and redirect the parked domains to .com ?
If you are wanting each to go to their own sites folder why would you not set them up as:
sites/example.org, sites/example.net, sites/example.com ?
Sorry, if I have misunderstood your question.
Izzy
Got a 301 redirect working very easily, perhaps not most elagant
Hey there;
OK., well, I tried the suggestion of redirecting my site1.org domain to my site1.com folder, but then got this message (of course, since Drupal does not have or use an index.htm, ESPECIALLY since this is a Multi-Site Install and so there is nothing in the site1.com folder except settings.php~!);
Directory has no index file.
Browsing this site or directory without an index file is prohibited.
If you are the site's webmaster, you can remedy this problem by creating a default HTML page with one of the following names:
index.html
index.htm
default.htm
Default.htm
home.html
Home.chtml
NOTE: Filenames are case sensitive, i.e., Home.html is not the same as home.html
Soo., then what I did was to create a blank HTML file (with the HEAD, BODY & HTML tags) and place that in the site1.org folder that I had also created and directed my domain name; site1.org to.
Then, once I ULed the empty HTML file to that new folder (site1.org), I also created a .htaccess file and placed that in the same folder (site1.org). Contents of the .htaccess file are;
redirectMatch 301 ^(.*)$ http://site1.com
The first time that I loaded the page I got a message "Page not Found", but upon refreshing, it now resolves perfectly to my site1.com domain.
This may or may not be the most elegant solution, but apparently the 301 redirect is a well used method to permanently redirect one domain to a new one.
Does this make sense and am I OK to be doing it this way? Please let me know if this may be a mistake down the road for any reason, otherwise, it is simple and easy and it WORKS.
Thanks for everyone's assistance~!
AK
redirectMatch 301 with .htaccess for permanent domain redirects
Hey everyone;
DOH., I just remembered that pre-Drupal I used the redirectMatch 301 redirect back in the "good old days" when I was doing straight HTML sites in notepad with just FTP access to my server host in the late '90's (?!) and this was the "prescribed" method to redirect one domain to another (new or other) domain.
My main concern is for SEO and proper forwarding and posting of page content in Search Engines. These are new sites and so this may not be as much of a concern, but for existing sites I think that this is also the prescribed (or one of the) way to do this.
What I like is that it is quick, easy and simple enough for anyone with FTP access to their server host and there is no need for editing server files other than in the public_html directory that any user would have access to. Thanks SO much again for everyone checking in with suggestions.
This is part of what makes Drupal the incredible platform that it is, The COMMUNITY of cool, helpful and interested people that are involved and support one another here. I feel very fortunate to have chosen Drupal over many other CMS solutions out there.
All the Best to You & Yours~!
AK
Redirecting with domain registrar account
Hi Ashokan,
What about redirecting(or forwarding) the domains with .net (or other extensions) to .com at the doamin registry itself (Most of the major domain registrars allow you to forward the domain to another). So each time you reinstall drupal or change hosting provider you don't have worry about .net not pointing to .com.