fansphp Posted May 11, 2009 Share Posted May 11, 2009 Hi All, I require your help. I have a domain name and there are around 100 links inside the domain name, for example, www.domain.com is the domain name and links are like this www.domain.com/1/123/ and www.domain.com/3/456 I am creating 100 subdomain on my domain name and what i require is that, there will be only 1 common index page of all the subdomain, when somebody goes to 1.domain.com it will take him to that index page, in that index page, it see the subdomain and and opens the include of the coressponding links. For this heres an example, if somebody goes to 1.domain.com it opens the index page, in index page theres a code, in the code it sees that for 1.domain.com it should put the php include link as www.domain.com/1/123 I am not sure about the code, <?php echo $_SERVER['SERVER_NAME']; ?> where i think server_name is subdomain.domain.com it than runs a query SELECT links FROM content WHERE subdomain = '$_SERVER[sERVER_NAME]' Please help me with this code. Or is there any other way to do it, so that in only 1 page, it understands the subdomain name and open the corresponding site, But there should be different Title for each of this pages. Thanx Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/ Share on other sites More sharing options...
Ken2k7 Posted May 11, 2009 Share Posted May 11, 2009 WOW! That is just ridiculous. 100 subdomains just to redirect someone? But I am lost on your question. What's your question? Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831779 Share on other sites More sharing options...
revraz Posted May 11, 2009 Share Posted May 11, 2009 This should be doable with mod rewrite. Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831799 Share on other sites More sharing options...
fansphp Posted May 11, 2009 Author Share Posted May 11, 2009 Here is the question in simple language, My Domain Name has many links which is very lengthy, i am creating subdomains for each links, all the subdomains will open a page where the links just opens up inside(using the php include command), i am not redirecting it, as these subdomains will have their individual titles too, what i want is instead of creating seperate individual index pages for each subdomains, i will creating a common index page, when somebody opens any of these subdomains, it opens that index page and inside that index page a query runs where it see the subdomain name and open the respective page with the corresponding Title. [attachment deleted by admin] Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831829 Share on other sites More sharing options...
Ken2k7 Posted May 11, 2009 Share Posted May 11, 2009 What's your question? Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831852 Share on other sites More sharing options...
fansphp Posted May 11, 2009 Author Share Posted May 11, 2009 Did you understand the matter, than please help me with the code which i can put on that index page, or if i have to create a sql table and run a query on that index page. Please tell me what you understood, so that i can explain you. Really sorry for my bad english Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831857 Share on other sites More sharing options...
Ken2k7 Posted May 11, 2009 Share Posted May 11, 2009 1. I can't help you because you haven't asked a question. You want an answer without a question? 2. What code? That one line is the code you need help with? Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831860 Share on other sites More sharing options...
jackpf Posted May 11, 2009 Share Posted May 11, 2009 Just found this - http://muffinresearch.co.uk/archives/2006/08/20/redirecting-subdomains-to-directories-in-apache/ Should do you nicely. Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831863 Share on other sites More sharing options...
Stryves Posted May 11, 2009 Share Posted May 11, 2009 I think the question is 1. Someone goes to one.domain.com 2. How do you grab the "one" and do a query to grab the links for anyone that goes to "one".domain.com, because someone going to "two".domain.com would receive a different set of links. mod rewrite would probably be easiest, because then you could have it specified via path and string... I'm guess if that's what you are looking for. Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831871 Share on other sites More sharing options...
revraz Posted May 11, 2009 Share Posted May 11, 2009 I gave you the answer earlier... Did you understand the matter, than please help me with the code which i can put on that index page, or if i have to create a sql table and run a query on that index page. Please tell me what you understood, so that i can explain you. Really sorry for my bad english Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831879 Share on other sites More sharing options...
fansphp Posted May 11, 2009 Author Share Posted May 11, 2009 I think the question is 1. Someone goes to one.domain.com 2. How do you grab the "one" and do a query to grab the links for anyone that goes to "one".domain.com, because someone going to "two".domain.com would receive a different set of links. mod rewrite would probably be easiest, because then you could have it specified via path and string... I'm guess if that's what you are looking for. You have actually understood to what i am looking for. Can you help me with this, the code.. Thanx alot Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831891 Share on other sites More sharing options...
fansphp Posted May 11, 2009 Author Share Posted May 11, 2009 Please reply. Please help me regarding the script, what script should i put in. Thanx Link to comment https://forums.phpfreaks.com/topic/157714-php-script-help/#findComment-831974 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.