Welcome Guest.   Make a donation to an author on the site October 24, 2014, 02:06:08 AM  *

Please login or register.
Or did you miss your validation email?


Login with username and password (forgot your password?)
Why not become a lifetime supporting member of the site with a one-time donation of any amount? Your donation entitles you to a ton of additional benefits, including access to exclusive discounts and downloads, the ability to enter monthly free software drawings, and a single non-expiring license key for all of our programs.


You must sign up here before you can post and access some areas of the site. Registration is totally free and confidential.
 
Check out and download the GOE 2007 Freeware Challenge productivity tools.
   
   Forum Home   Thread Marks Chat! Downloads Search Login Register  
Pages: [1]   Go Down
  Reply  |  New Topic  |  Print  
Author Topic: Any CPanel Gurus out there?  (Read 1693 times)
Carol Haynes
Waffles for England (patent pending)
Global Moderator
*****
Posts: 7,958



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« on: August 21, 2010, 06:48:12 AM »

I have a CPanel account with one main domain registered (say main.com) and two parked domains (parked1.com and parked2.com).

I want to set it up so that if anyone puts any of those three domain names into a browser then the parked1.com domain is visited and the URL changed to reflect the correct URL.

Currently if I put any of the domain names into a browser the website displays properly but with the URL I entered not based on parked1.com?

Any ideas how to achieve this?

I have tried domain redirects (both in the Parked domain section, and the Redirects section) but they seem to have no effect. It may be because I have a .htaccess file which may override redirects (but I don't know a lot about .htaccess to change a complex file).
Logged

AndeT1
Supporting Member
**
Posts: 9



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #1 on: August 21, 2010, 11:56:30 AM »

I think you actually have to get into the HTML on your main page.
In the header area of your default page (index.htm or index.html), but a little JavaScript that looks at the actual page requested and then re-routes the browser to that page.
In this way, the user is sent to the page requested, no matter what the main page is named.
or
Change your parked domains to addon domains and you'll get exactly what you want. :-)
« Last Edit: August 21, 2010, 12:03:15 PM by AndeT1 » Logged
Carol Haynes
Waffles for England (patent pending)
Global Moderator
*****
Posts: 7,958



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #2 on: August 21, 2010, 12:15:15 PM »

So something like this:

[copy or print]
<html>
<head>
  <script type="text/javascript">
       <!--
          if document.domain != "www.parked1.com"
              {
                document.location = "http://www.parked1.com"
              }
       //-->
  </script>
</head>

<body>



</body>
</html>

This would work if I was using HTML but it is a Joomla based website and this would mean placing this in the template and having it test every time a page is requested.

Is there anyway I can set this up in the .htaccess or in CPanel so that it happens automatically?
« Last Edit: August 21, 2010, 02:50:36 PM by Carol Haynes » Logged

AndeT1
Supporting Member
**
Posts: 9



see users location on a map View Profile Read user's biography. Give some DonationCredits to this forum member
« Reply #3 on: August 21, 2010, 12:59:25 PM »

As above:

"or
Change your parked domains to addon domains and you'll get exactly what you want. :-)"
Logged
MilesAhead
Member
**
Posts: 4,946



View Profile WWW Give some DonationCredits to this forum member
« Reply #4 on: August 21, 2010, 01:41:30 PM »

I just have the single domain, so I'm not familiar with these other features.  But I know there are a ton of .htaccess guides on the web.  Many very detailed.  Also you might look for a forum by your hosting service.  Many times other users will know the exact .htaccess command/feature to point you in the right direction.

Sounds like AndeT1's solution is the simplest. But I can't verify it from my limited experience. Sad
Logged

"Genius is not knowing you can't do it that way."
- MilesAhead
Carol Haynes
Waffles for England (patent pending)
Global Moderator
*****
Posts: 7,958



see users location on a map View Profile WWW Give some DonationCredits to this forum member
« Reply #5 on: August 21, 2010, 02:48:42 PM »

Thanks for the feedback.

I just found a .htaccess solution that works:

[copy or print]
RewriteEngine on
RewriteCond %{HTTP_HOST} !^www.parked1.com$
RewriteRule ^(.*)$ http://www.parked1.com/$1 [R=301]

Had a bit of a puzzle where to put this in .htaccess but found it worked fine if I put it before SEF rewrites.
Logged

Pages: [1]   Go Up
  Reply  |  New Topic  |  Print  
 
Jump to:  
   Forum Home   Thread Marks Chat! Downloads Search Login Register  

DonationCoder.com | About Us
DonationCoder.com Forum | Powered by SMF
[ Page time: 0.101s | Server load: 0.42 ]