Redirection for sub-domains does not work

It's not difficult to install myLounge Redirection, but sometimes it's quite tricky. Post your questions in here.

Moderator: Scooby

Redirection for sub-domains does not work

Postby Maximus » Sat Nov 15, 2003 8:24 pm

First, it's a very good script :-)....thanks.

...but redirection for sub-domains does not work.
http://www.bq--abrws5dsn7vw4.mltbd.com


Two test sub-domains I have registered:
http://test.bq--abrws5dsn7vw4.mltbd.com
http://test2.bq--abrws5dsn7vw4.mltbd.net

Same result with unregistered domains: e.g. http://test-unregistered.bq--abrws5dsn7vw4.mltbd.com

http://www.bq--abrws5dsn7vw4.mltbd.com/anything-stupid is redirected to http://www.bq--abrws5dsn7vw4.mltbd.com/home.htm


my DNS settings:

bq--abrws5dsn7vw4.mltbd.com. 14400 IN NS ns1.totalchoicehosting.com.
bq--abrws5dsn7vw4.mltbd.com. 14400 IN NS ns2.totalchoicehosting.com.
bq--abrws5dsn7vw4.mltbd.com. 14400 IN A 216.180.225.178
localhost.bq--abrws5dsn7vw4.mltbd.com. 14400 IN A 127.0.0.1
bq--abrws5dsn7vw4.mltbd.com. IN MX 10 MAIL.OEMMAIL.COM.
themail 14400 IN CNAME WEB.OEMMAIL.COM.
www 14400 IN CNAME bq--abrws5dsn7vw4.mltbd.com.
ftp 14400 IN A 216.180.225.178
* 14400 IN A 216.180.225.178

I have access to cpanel and whm.

Could you please enlighten me? :-)

btw does www in front of the sub-domains work? e.g. http://www.test.bq--abrws5dsn7vw4.mltbd.com

Thanks :-)

Maximus
Maximus
 

Postby Scooby » Sat Nov 15, 2003 8:57 pm

Do you have full access ie is it your own server?

As i run cp and whm and can add my own dns zone and the wildcard dns.

But the server admin has to add it as a server alias for it to work.

I will get hold of him to find out what hes done as there seems to be plenty of problems with cpanel hosts and wildcard dns.

** Edit

yes subdomain redirection works with and with out www
User avatar
Scooby
helpful guy
helpful guy
 
Posts: 252
Joined: Fri Jan 24, 2003 2:04 pm
Location: UK

Postby Maximus » Sun Nov 16, 2003 10:51 pm

Scooby,

Thanks for your quick reply.

It is not my server.
I already asked the server admin to do the necessary modifications to the server. Maybe he knows what to do.
Maximus
 

Postby Guest » Sun Nov 16, 2003 11:50 pm

The answer from my server admin

As far as I can tell by quickly looking at the script, this would require changes server wide that would affect other users, and hence is not something we would plan to do, sorry about that.
Guest
 

wildcard DNS

Postby Maximus » Mon Nov 17, 2003 4:10 pm

If I use the free mydomain.com DNS service then I should have a static IP to point the my web space, right?
Maximus
 

Postby Scooby » Mon Nov 17, 2003 4:23 pm

Right for all cpanel users to have the wildcard dns working you need

httpd.conf requires *.domain.com for a serveralias

The domain's zone file: * as an A entry.

The httpd.conf file can only be changed by server admin/owner

The dns zone you can change if you have access to web host manager
User avatar
Scooby
helpful guy
helpful guy
 
Posts: 252
Joined: Fri Jan 24, 2003 2:04 pm
Location: UK

dns settings

Postby fergus » Tue Dec 09, 2003 7:38 pm

hi
i have my dedicated server with plesk 6 admin.
i logged ssh to the root and edit the httpd.conf file manually looking the place where to change or add the *.domain.com

but Where is it located ? Im using Pico editor within the server, but dont know where to put this line.

any help ?
fergus
 

Postby Scooby » Tue Dec 09, 2003 8:04 pm

becareful using pico it will wrap the text lines.

found this post on how to do it in conf file hope it helps dont forget to add wildcard in the dns zone for the domain as well

The following should work on plain linux boxes. It might be a bit different if you use something like Ensim, Plesk, etc.

1.) backup your current httpd.conf:
cp /etc/httpd/conf/httpd.conf /etc/httpd/conf/httpd.conf.bak
2.) edit your httpd.conf using your favourite text editor, e.g.
vi /etc/httpd/conf/httpd.conf
3.) find the VirtualHost entry for the domain. Such an entry will begin with "<VirtualHost 127.0.0.1:80>" (where 127.0.0.1 is your domains IP) and end with "</VirtualHost>". It will normally include two lines like:

PHP:
--------------------------------------------------------------------------------
ServerName www.domain.com
ServerAlias domain.com

--------------------------------------------------------------------------------


Add a wildcard to that ServerAlias entry:
PHP:
--------------------------------------------------------------------------------
ServerName www.domain.com
ServerAlias domain.com *.domain.com

--------------------------------------------------------------------------------


If the RewriteEngine should be enabled for this domain ("RewriteEngine on"), disable it:
PHP:
--------------------------------------------------------------------------------
RewriteEngine off

--------------------------------------------------------------------------------

After you have made your changes you have to restart apache and bind:


scoobs
User avatar
Scooby
helpful guy
helpful guy
 
Posts: 252
Joined: Fri Jan 24, 2003 2:04 pm
Location: UK

Postby Guest » Tue Dec 09, 2003 8:16 pm

thanks scooby 4 the fast reply,
but I logged as root and edit the httpd.conf and no virtual host is there, may be because I have just 1 IP based domain in the dedicated server

any help?
Guest
 

Postby Scooby » Tue Dec 09, 2003 9:27 pm

you could try adding it make a backup first just in case.

have a look @ this url theres some examples there that should help

http://httpd.apache.org/docs/vhosts/examples.html

scoobs
User avatar
Scooby
helpful guy
helpful guy
 
Posts: 252
Joined: Fri Jan 24, 2003 2:04 pm
Location: UK

Postby Guest » Tue Apr 06, 2004 6:06 pm

i've setup the wildcard, but it point to my hosting provider's site instead of mine, what happened?
Guest
 

Postby plamen » Tue Dec 14, 2004 3:00 pm

The same here. When httpd.conf is not modified, the redirection brings me to the host site xxx.com, when the httpd is modified, the redirection of yyy.zzz.com opens the main site zzz.com as yyy.zzz.com, i.e., serves as alias.

Or probably we should wait first for the propagation to take place, and only then change the httpd.conf?

* * *
If the RewriteEngine should be enabled for this domain ("RewriteEngine on"), disable it:
PHP:
----------------------------------------------------
RewriteEngine off
What's the point?

Thank you
plamen
 

Postby Plamen » Tue Dec 14, 2004 3:54 pm

I mean, why it should be disabled when it must be on. Doesn't it suffice to start the RewriteEngine from the .htaccess?
Plamen
 

Postby Plamen » Wed Dec 15, 2004 5:42 pm

OK, I've moved the script from the subdomain to the main domain, and installed it on all domains I intend to offer redirection service from, then modified the httpd.conf - and now everything works perfectly well (BTW, with "* CNAME xxx.xxx.xxx.xxx" in the WHM edit DNS Zone. All domains share one IP.

Probably, this kind of information has to be added to the README file for all those who intend to offer the service from multiple domains.

Thanks again for the nice script. I've seen it first working on a php-nuke site, as a Nuke module, but the instructions of the modules's author were quite unitelligible, so, I preferred to directly install the original script with a php-nuke site. This applies to any other sites that already have a functional index.php on them.

Change the old index.php to start.php
Open mainfile.php (php-nuke) and replace all instances of index.php to start.php

In the configuration room, put start.php as the starting page of the site.

Upload all files, and that's it.
Here it is:
www.indology.net

To register a subdomain, go to www.indology.net/myred/register.php

And one more question. What to do with the existing real subdomains? We are losing them as separate sites because they start to point to the main domain. Is there a way to preserve their independence and real functionality?

Thank you!
Plamen
 

When I use Setup.php...

Postby dsgncr8or » Thu Feb 17, 2005 1:46 am

and results in a username that is:
username@serveddomain.com@dedicated.server.com

and believe that it is related to this aliasing issue - but am not sure. And I fear this response because Aliasing can create security issues....

Anonymous wrote:The answer from my server admin

As far as I can tell by quickly looking at the script, this would require changes server wide that would affect other users, and hence is not something we would plan to do, sorry about that.


Soooooo... could someone please help me find the solution or direct me in providing the info needed to help.
--

dsgncr8or
dsgncr8or
Newbie
Newbie
 
Posts: 3
Joined: Thu Feb 17, 2005 1:25 am
Location: Saint Louis, MO; EARTH

Next

Return to Support

Who is online

Users browsing this forum: No registered users and 5 guests

cron