Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 268
  • Last Modified:

mod-rewrite or other solution?

I need to make the most of apache in that, I have a system setup that has about 12 domains going to 1 IP on a shared server, I need in the root directory to have an .htaccess file that basically does this:

if the hostname = www.domain1.com
then the content comes from /domain1.com
if the hostname = www.domain2.com
then the content comes from /domain2.com

but here is the issue, i want to make it so that always in the Address bar in the browser it always shows as that the visitor is in the base directory

like if the visit www.domain1.com and want the file terms.php
using standard redirection would show http://www.domain1.com/domain1.com/terms.php
but I need it to show http://www.domain1.com/terms.php


Any ideas anyone, I know this is possible as I have seen it before, but dont know how it was done
0
Mike Miller
Asked:
Mike Miller
  • 3
  • 2
1 Solution
 
yuzhCommented:
Why don't you setup virtual hosts? it is the solution for your job, please have a
look at:

http:Q_20859488.html

also see:

http:Q_21119902.html
0
 
Mike MillerPresidentAuthor Commented:
the primary reason, is that I dont own the server, and two that all the sites need to use the same basic backend system, although the other parts are entirely different such as the static content
0
 
yuzhCommented:
You still can use virtual hosts in this case.
eg, maintain diferent "Document Root" for each virtual host (domain), use  "symbolic link"
to point to the common area (dir), and put the customized contents under the "Document Root".

0
 
Mike MillerPresidentAuthor Commented:
As I mentioned before I do not own the server to have access to the httpd.conf file or even making the different doc roots
0
 
yuzhCommented:
Sorry, you can't do it!

Have a nice weekend!
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now