FreePgs.com Forum
April 29, 2017, 01:34:57 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Click Here for Toll-Free Service for your business starting at $2.00 per month and 4.5 cents per minute
 
   Home   Help Search Login Register  
Pages: [1] 2   Go Down
  Print  
Author Topic: '07: Multiple Domain Names using .htaccess  (Read 17191 times)
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« on: February 04, 2007, 02:44:52 PM »

  Newbie here, a bit confused by your instructions on how to
use multiple domain names with subdirectories using .htaccess
The original thread is HERE.

  Why did member "x" called these instructions cheap and amateurish?

  These instructions tell me that I must ask you to add *.mydomain.com to
my account, but I got an error, unacceptable characters, using the *,
when adding it using the Setup Domains page.

   Using two domain names, can someone please clarify how to modify
these scripts, if the two domain names are actually called:
domain1.com and domain2.com

If you need to apply this change to only ONE domain,
put this code in /.htaccess (root):

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} ^(www\.)?EXAMPLE.NET$
RewriteRule ^(DIRECTORY\/)?(.*)$ DIRECTORY/$2 [L]


Then, in DIRECTORY/.htaccess (subdomain folder), write
the following code:

Code:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^(www\.)?EXAMPLE.NET$
RewriteRule ^(DIRECTORY/)?(.*)$ http://www.EXAMPLE.NET/$2 [L,R=301]


Thanks in Advance,
East


« Last Edit: February 04, 2007, 03:11:05 PM by doctoreast » Logged
bonehead
Verified Account
Full Member
*

Karma: +4/-2
Offline Offline

Posts: 178

Blog entries (0)

View Profile WWW
« Reply #1 on: February 04, 2007, 09:14:25 PM »

Set your domain dns to the servers dns ips. Set the secondary domain dns to the ip or to the http folder like http://www.Huh.Huh/folder

Then contact support and have them set the server to your account and folder.
Logged
FreePgs.com Forum
« Reply #1 on: February 04, 2007, 09:14:25 PM »

 Logged
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« Reply #2 on: February 05, 2007, 07:53:57 PM »

Bonehead,

  After some thought, I think that yours is the correct
process; and that the entire rewrite/htaccess idea
appears to be an attempt by admin to eliminate the 
work of adding vhosts; which is understandable.

  One of my hosting companies has me on one of those
plesk servers with some music download site, who keeps
writing me about content, wanting me to stay away from
the ram (doesn't want me to use any media files).  Well,
I don't have any at all.  This nonsense just has me weary,
and I may just jump ship, which is why I am looking into this.

  Looks like freepgs may not want to handle this your way,
and so I may have to do it their way.  I've emailed admin, but
they have not yet replied.

Thanks,
East
Logged
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« Reply #3 on: February 05, 2007, 09:23:18 PM »

Update: admin has added *.doctoreast.com
to my account, and so it looks like this is now
going to work. I've changed hosting info on
my 2nd domain name, and am waiting for it to
propogate.
« Last Edit: February 05, 2007, 10:07:44 PM by doctoreast » Logged
FreePgs.com Forum
« Reply #3 on: February 05, 2007, 09:23:18 PM »

 Logged
brainiac744
Verified Account
Sr. Member
*

Karma: +10/-0
Offline Offline

Posts: 403

Blog entries (0)

View Profile
« Reply #4 on: February 05, 2007, 09:51:37 PM »

If you still need help with htaccess I can try, I have subdomains off of one main domain set up and working on my account, I'm not sure how different regular domains would be to set up (I'm assuming not much).
Logged
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« Reply #5 on: February 05, 2007, 10:52:20 PM »


   Still waiting, 24hrs, for hosting ip
to propogate.  I googled this subject,
and came up with some handy links.

http://corz.org/serv/tricks/htaccess2.php?page=all

Logged
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« Reply #6 on: February 06, 2007, 09:30:33 PM »

Resolved:
Solution was not to add *.mydomain.com to my
account for the second domain name, but to add the
second domain name itself, and then to use the
two .htaccess scripts to redirect it to a subfolder
of my main domain.  Both of the scripts, root and
subfolder, I put my second domain folder & name
info.

http://www.youtube.com/watch?v=6xhYk9PEmXA&mode=related&search=

PE

 
« Last Edit: February 06, 2007, 09:37:08 PM by doctoreast » Logged
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« Reply #7 on: February 08, 2007, 11:40:16 AM »

Hi,
  Do I need to put .htaccess scripts in all folders?  For some
strange reason,

http://wholives.com/forum
is coming up as
http://wholives.com/wholives/forum

eAst
Logged
brainiac744
Verified Account
Sr. Member
*

Karma: +10/-0
Offline Offline

Posts: 403

Blog entries (0)

View Profile
« Reply #8 on: February 08, 2007, 02:45:32 PM »

just in the root folder, and one in the /wholives folder should be sufficient. If you already have one in both post the contents of those files here. If you don't, post the contents of the one that you do have here. (the mod_rewrite parts anyway)
Logged
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« Reply #9 on: February 08, 2007, 04:03:12 PM »

Hi,
 Doesn't do it every time, but nearly every time:
Gallery is doing the same:

http://wholives.com/forum
http://wholives.com/gallery


Root (doctoreast.com has)
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^(www\.)?wholives.com$
RewriteRule ^(wholives\/)?(.*)$ wholives/$2 [L]

domain2 (/wholives, wholives.com) folder
Code:
RewriteEngine on
RewriteCond %{HTTP_HOST} !^(www\.)?wholives.com$
RewriteRule ^(wholives/)?(.*)$ http://www.wholives.com/$2 [L,R=301]


Thanks in Advance,
east
« Last Edit: February 08, 2007, 04:38:00 PM by doctoreast » Logged
brainiac744
Verified Account
Sr. Member
*

Karma: +10/-0
Offline Offline

Posts: 403

Blog entries (0)

View Profile
« Reply #10 on: February 08, 2007, 06:28:11 PM »

Alright, try this:

Change the first (root) file to:
RewriteEngine on
RewriteCond %{HTTP_HOST} ^wholives.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.wholives.com$
RewriteRule ^(.*)$ wholives/$1 [L]

And in the domain2 folder change the htaccess file to:
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.wholives.com$
RewriteRule ^(wholives/)?(.*)$ http://www.wholives.com/$2 [L,R=permanent]

That's (similar) to how I have mine set up and I don't suffer from the directory after the domain problem that you seem to be having. Let me know if that doesn't work and I'll see if I can find another solution.
Logged
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« Reply #11 on: February 08, 2007, 06:46:18 PM »

Brainiac,
  Still does the same thing. 
I deleted cookies and cache,
but no help either.

  If you guys want the forum
header for freepgs, just let me know.

East
Logged
brainiac744
Verified Account
Sr. Member
*

Karma: +10/-0
Offline Offline

Posts: 403

Blog entries (0)

View Profile
« Reply #12 on: February 08, 2007, 08:26:00 PM »

Are you sure? I just visited wholives.com and clicked the forum link and it didn't add anything odd in the path for me...
Logged
doctoreast
Verified Account
Jr. Member
*

Karma: +2/-4
Offline Offline

Posts: 60

Blog entries (0)

View Profile
« Reply #13 on: February 08, 2007, 09:04:58 PM »

B,
  Gallery and Forum is doing this. 
I'm using IE, not FF.  I killed cache/cookies,
rebooted, and it;s still adding the sub folder.

Does it if I click these links here or enter
http://wholives.com/forum
http://wholives.com/gallery
into address bar

Mike
« Last Edit: February 08, 2007, 09:29:52 PM by doctoreast » Logged
brainiac744
Verified Account
Sr. Member
*

Karma: +10/-0
Offline Offline

Posts: 403

Blog entries (0)

View Profile
« Reply #14 on: February 08, 2007, 09:48:03 PM »

how interesting...if I end the link with a / or a /index.php then it doesn't change the directory. If I DON'T end it with a /, it DOES change the directory. Do you have multiviews on by chance? If so turn that off and try it again, if not I'll look more into that htaccess file.
Logged
Pages: [1] 2   Go Up
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.21 | SMF © 2015, Simple Machines Valid XHTML 1.0! Valid CSS!