Here's my problem
I have a hosting provider (hostingprovider) and also several different domains that I bought with a different provider (sitea.fr, siteb.fr, www.sitea.fr, www.siteb.fr)
What I would like to achieve is this :
When you request either www.sitea.fr or sitea.fr, point that to hostingprovider/lfr/ without changing the url
Same with siteb, but with a different subfolder: siteb.fr->hostingprovider/tac/, www.siteb.fr->hostingprovider/tac/
I can't for the life of me find anything relevant to my problem. At the moment both sitea and siteb point to the root of hostingprovider, but I can't figure out how to make them point to their respective subfolders.
Any help is greatly appreciated.
Ok, addon domains solve my problem.
Related
I know there are many .htaccess questions and aswers here and on the internet, but I can't find the answer in all the noise I am looking for. I am on a shared server. If you go to domain abc.com it access folder abc. IF you go to domain def.com it access folder def. What I want is if you go abc.com it must reroute the domain to folder def and send it a static value saying this is from abc... in that way I can have multiple domains access the same code in one folder and don't have to duplicate the code over and over again. Any ideas and solutions and comments will be extremely welcome and deeply appreciated. thanks
Alright, here's the dilemma I have. First off, I am by far not a Windows Server person. Not a huge fan of it at all, but I have no choice but to use it where I am.
I have a domain example.ag.mydomain.com
I would like to change this to example1.ag.mydomain.com
However, I want to be able to set it so if someone goes to example.ag.mydomain.com/wordpress it will redirect them to example1.ag.mydomain.com/wordpress.
I do have access to the DNS but I really have no clue how to do this, would this be a wildcard DNS or would this need to be set up differently?
I appreciate your help!
I'm trying to host a sub domain of another website on my hosting because of compatibility.
I have a.com and api.b.com pointing to my server. Basically, what I am trying to accomplish is a.com to have its default behavior but api.b.com to be rewritten to a folder called api. Which is located in the root of a.com
Everything I've tried either does nothing or give me a 500 error. A lot of the people that had similar issues on this website their solutions did not work for me.
Please let me know if I need to provide any additional information.
Thanks,
Hans
You can create 2 VirtualHost Files With Document Roots as Given.
A.com
Document Root : / or ROOT_OF_A
api.a.com
Document Root : /api or DIRECTORY_NAMED_API_UNDER_ROOT_OF_A
Hope It will work! Let me Know if it does!
I have two domains, lets say www.A.com and www.B.com which are located on the same server. The directory is like this:
/html/index_of_A.php
/html/content_of_b/index_of_B.php
Now i want to configure an .hataccess file, which does the following things:
1) redirect users which enter A.com to /html/index_of_A.php (which is actually www.A.com) and
2) redirect users which enter B.com to /html/content_of_b/index_of_B.php
At the end, users enter two domain names (a.com and b.com) and they are getting redirected respectively to the specific folders of the domains.
Is that possible with htaccess?
The reason for this is, that i have two domain names, but they are on one server. Now I want to seperate both of them, to make "two different web pages".
Further, the users should always get rediretet to the www version.
Unfortunately I have no idea how to do that... I did some searches and tried different methods, but no success :(
Hope anybody can help me, appreciate that!
If I understand you problem correctly, there is no need to configure an .htaccess file.
You can solve your problem by slightly reorganizing your folder structure.
This is how I would solve it:
[folder for domain A/index.php]
[folder for domain B/index.php]
Configure your domain registration for www.A.com to point to [folder for domain A]
Configure your domain registration for www.B.com to point to [folder for domain B]
This way there is no need for an .htaccess file unless you are setting one up for security reasons (not redirection) AND you don't have to muddle through www.A.com's files when you need to focus on www.B.com.
I hope this helps.
I have been searching and looking for the answer to this for SO long now without any joy, I hope someone can help.
Okay I have a web structure of:
Main folder - This is where you first land prior to logging in. After you log in you will be either directed to a number of websites that are resident in a sub-folder called websites. The problem I have is that I would like the document root, say the $_SERVER['DOCUMENT_ROOT'] variable, to default to the root of the website folder that it has been directed to. You see I have a lot of $_SERVER['DOCUMENT_ROOT'] in my php code and I use the '/' slash a lot in the href on my HTML tags.
I have seen that I could accomplish this by adding a .htaccess in the root of eiach website folder but 1, would like work for my situation and 2, could anyone please help me with the code. I understand I can use the RewriteRule command but I can't get my head around it. My folder stricture is like this:
login (index.html)
websites folder
website1 (index.html)
website2 (index.html)
website3 (index.html)
I have tried many versions of using RewriteCond etc but non of them work.
If anyone can help me out here I'd be very grateful.
Thanks
Nothing you can do in your htaccess file that's going to be able to change the document root. One thing that you can do is create separate domains that you can make their document roots point to each of the websites folders. Then proxy to one of those domains.
That way the URL on the browser doesn't change domain names, and internally, you're proxying requests back to yourself and the individual website domains will each have their own document root.