SunQuest
           Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
Generate data entry and reporting .NET Web apps in minutes, straight from your database. Read our FREE whitepaper “Build Web 2.0 Applications Without Hand-Coding” Download now!
  #1  
Old January 26th, 2001, 03:10 PM
hanumani hanumani is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Aug 2000
Location: wendell, mass, USA
Posts: 87 hanumani User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 7 m 18 sec
Reputation Power: 8
Wink

I've been through the apache doc and can't quite nail this one down.
I'm trying to have my .htaccess send different domain names to different places.

scalenet.com is the main domain, but lab-balances.com goes to the same IP. If the user types in lab-balances.com/stuff/someotherstuff.html I want it to go to that page on the scalenet server, which it currently does. but if the user types in just lab-balances.com I want it to go to a certain page, lab-balances.com/x/y/ not to the index page that scalenet.com goes to now.
Please, any help would be appreciated, this is what I have now (doesn't work)
# -FrontPage-

RewriteEngine On
Options +FollowSymlinks
RewriteBase /
Rewrite Rule for machine.domain-name.net
RewriteCond %{HTTP_HOST} lab-balances.com$
RewriteCond %{REQUEST_URI} !scales/type/2/
RewriteRule %0 lab-balances.com/scales/type/2/

DirectoryIndex index.php3
IndexIgnore .htaccess */.??* *~ *# */HEADER* */README*

ErrorDocument 404 /index.php3


Reply With Quote
  #2  
Old January 31st, 2001, 04:19 PM
freebsd freebsd is offline
Contributing User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Jan 2001
Posts: 5 freebsd User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: < 1 sec
Reputation Power: 0
RewriteEngine On
Options +FollowSymlinks
RewriteBase /
RewriteCond %{HTTP_HOST} ^lab-balances\.com$
RewriteCond %{REQUEST_URI} ^$
RewriteRule ^(.*) /server/path/to/lab-balances.com/scales/type/2/index.html

Note, this is internal redirect, which means user see http://lab-balances.com/ in location bar but apache internally launches your index.html from the above server path.

As for external redirect, assuming the docroot for lab-balances.com is /server/path/to/lab-balances.com, the user will see http://lab-balances.com/scales/type/2/index.html
To use external redirect, replace the bold with the following:
RewriteRule ^(.*) http://lab-balances.com/scales/type/2/index.html [R,L]

I haven't tested this though.

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > mod_rewrite reg expression coding


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 6 hosted by Hostway