I have a server under one main domain, and I want to point another domain to /example/index.php to make another site.
Is there anyway i can do this with .htaccess?
cheers
|
I have a server under one main domain, and I want to point another domain to /example/index.php to make another site. Is there anyway i can do this with .htaccess? cheers | |||||||
feedback
|
This question came from our site for professional and enthusiast programmers.
|
No, .htaccess is for other things. | |||||
feedback
|
|
You can have two distinct sites by using the virtualhost facility, e.g. (just part of a much bigger configuration ...)
If you want to refer to part of the hierarchy of one site as another, this is possible in the same way, e.g. the second entry above could be
However, depending on the design of the site, this may work badly as pages in the 'frodch' heirarchy would probably still have links, defined as local, to resources that are not in the frodch heirarchy (perhaps to /img/... or /contacts.php and so on) and these would not be accessible. A simpler approach can be to not define the new domain on the web host but to use the domain name host facility to, for example, do an HTTP redirect for the new domain name to the main domain's subdirectory. That way the user selecting the new domain arrives at the appropriate subdirectory page of the larger site but is still within the larger site so all the links and resources are available as usual. | |||
|
feedback
|
|
It should be possible with .htaccess and mod_rewrite (apache webserver is required). Put something like this in your .htaccess - file.
| ||||
|
feedback
|