scvinodkumar Posted April 15, 2009 Share Posted April 15, 2009 hi i have created 5 sub-domain. and i need to access the same files for these 5 sub-domains. but i dont want to upload all the files in each sub-domain folder. for example, --root --folder1 --folder2 --folder3 --folder4 --subdomain folder consider site.com is a domain and subdomain.site.com is a subdomain if i enter the url http://site.com/folder1/ like this then i can access all the files under the folder1 suppose if enter the url http://subdomain.site.com then how to access all the files under the folder1 i hope u peoples can under this easily please help me... Quote Link to comment https://forums.phpfreaks.com/topic/154237-subdomain-help/ Share on other sites More sharing options...
mrMarcus Posted April 15, 2009 Share Posted April 15, 2009 assume you have an image in folder1 you want to access .. you could simply point to it like so, <img src="http://site.com/folder1/image1.jpg" /> from anywhere. real easy. Quote Link to comment https://forums.phpfreaks.com/topic/154237-subdomain-help/#findComment-810851 Share on other sites More sharing options...
scvinodkumar Posted April 15, 2009 Author Share Posted April 15, 2009 hi thanks for your reply. consider i have a file test.php in folder1 i will access this file by using the url http://site.com/folder1/test.php now i want to access the same file using subdomain, like http://subdomain.site.com/folder1/test.php Quote Link to comment https://forums.phpfreaks.com/topic/154237-subdomain-help/#findComment-810859 Share on other sites More sharing options...
mrMarcus Posted April 15, 2009 Share Posted April 15, 2009 ok, you gotta be more specific with your question(s), and what you're trying to achieve. are you trying to include a file into an existing script/file? or are you just trying to access a file like you would an image? Quote Link to comment https://forums.phpfreaks.com/topic/154237-subdomain-help/#findComment-810864 Share on other sites More sharing options...
laffin Posted April 15, 2009 Share Posted April 15, 2009 subdomains arent handled by PHP or htaccess. Subdomains are handled by yer dns provider. Quote Link to comment https://forums.phpfreaks.com/topic/154237-subdomain-help/#findComment-810871 Share on other sites More sharing options...
scvinodkumar Posted April 15, 2009 Author Share Posted April 15, 2009 sorry i think i confused u... let me explain clearly, i have a domain http://site.com and there is many folders like folder1,folder2, and etc and each folder there is a test.php file i can access test.php from all the folders by using the url http://site.com/folder1/test.php or http://site.com/folder2/test.php, etc in the browser and now i created the sub-domain "test" so the url will be http://test.site.com the problem is how to access the test.php from the folder folder1,folder2,etc using the subdomain for example, if i enter the url in the browser http://test.site.com/folder1/test.php Quote Link to comment https://forums.phpfreaks.com/topic/154237-subdomain-help/#findComment-810890 Share on other sites More sharing options...
laffin Posted April 15, 2009 Share Posted April 15, 2009 u mean like <?php echo $_SERVER['SERVER_NAME']; ?> Quote Link to comment https://forums.phpfreaks.com/topic/154237-subdomain-help/#findComment-810894 Share on other sites More sharing options...
scvinodkumar Posted April 15, 2009 Author Share Posted April 15, 2009 yes you right Quote Link to comment https://forums.phpfreaks.com/topic/154237-subdomain-help/#findComment-810898 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.