Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: htaccess - rewriterule



Instead of the mod_rewrite, you can just use the actual name-based virtual host solution built in to Apache. There is a good article on Apple's site describing how to do this at http://developer.apple.com/ server/optimizexserve.html It's a bit old, but still should be valid.

On Jul 30, 2006, at 9:33 AM, Michael Ghilissen wrote:

Hi list,

I am struggling with the following problem. Could someone point me in the right direction with comments or suggestions?

I have a website (A.com) hosted at DNS 12.345.678.999. I want to create a 'virtual hosting' situation for a second website with its own URL (B.com) to be hosted at the same Apache server, along with the first website.

I have created a folder <siteB>, at the root of the server, which contains the website. I want to create an .htaccess document to 'rewrite' the requests for www.b.com AND b.com to go to that folder. I have tried with the following code, and many variations, but do not seem to get it right:

--
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} B.com$
RewriteCond %{REQUEST_URI} !siteB/
RewriteRule ^(.*)$ siteB/$1
--

I would like the redirection to be totally transparent to the user.

Thanks for your help,

Michael


_______________________________________________ Do not post admin requests to the list. They will be ignored. Web-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden

_______________________________________________ Do not post admin requests to the list. They will be ignored. Web-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/web-dev/email@hidden

This email sent to email@hidden
References: 
 >htaccess - rewriterule (From: Michael Ghilissen <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.