Tycoon Talk
Become a Big fish!
The number 1 forum for online business!
Post topics, ask questions, share your knowledge.
Tycoon Talk is part of Freelancer.com - find skilled workers online at a fraction of the cost.

Website and Server Administration Forum


You are currently viewing our Website and Server Administration Forum as a guest. Please register to participate.
Login



Reply
Old 05-08-2008, 10:27 PM Question RewriteRule help
Junior Talker

Posts: 4
Trades: 0
Apache on Windows 2003 SP2.

Lets say I have a site that is accessible by these URL's:

http://somelocalsvr/directory
http://192.168.1.1/directory

I want to redirect all requests that come via 192.168.1.1 to a subdirectory, ie. http://192.168.1.1/directory > http://192.168.1.1/directory/subdirectory

So I have this rule:

Code:
RewriteCond %{HTTP_HOST} ^192.168.1.1
RewriteCond %{REQUEST_URI} !^/directory/subdirectory(.*)$
RewriteRule ^/directory(.*)$ /directory/subdirectory$1 [R]
This works fine, but I don't want to show /subdirectory in the URL. I want it to transparently pass the request to /directory/subdirectory, like a pass-through.

Is there any way I can achieve this?

Thanks in advance for any help...
papastreets is offline
Reply With Quote
View Public Profile
 
 
Register now for full access!
Old 05-10-2008, 06:27 PM Re: RewriteRule help
chrishirst's Avatar
Missing! presumed drunk.

Posts: 41,520
Name: Chris Hirst
Location: Blackpool. UK
Trades: 0
unless yours is the first or only site on the IP. HTTP requests for the IP won't even get as far as .htaccess.
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
A foolish consistency is the hobgoblin of little minds
Thought for today:- I SEO the only industry where all the cowboys are Indians?
chrishirst is online now
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-10-2008, 11:09 PM Re: RewriteRule help
Junior Talker

Posts: 4
Trades: 0
Thanks for the reply, but can you explain it a little further?

FYI at this point the rule about does work as expected, but I don't want to show the subdirectory in the resulting URL.
papastreets is offline
Reply With Quote
View Public Profile
 
Old 05-11-2008, 12:30 AM Re: RewriteRule help
tamar's Avatar
Webmaster Talker

Posts: 507
Name: Tamar Weinberg
Location: New York
Trades: 0
Quote:
Originally Posted by chrishirst View Post
unless yours is the first or only site on the IP. HTTP requests for the IP won't even get as far as .htaccess.
I think he's talking about an intranet setup -- like for users in his office. So I'm not sure if that makes a difference.
__________________

Please login or register to view this content. Registration is FREE
tamar is offline
Reply With Quote
View Public Profile Visit tamar's homepage!
 
Reply     « Reply to RewriteRule help
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML



Page generated in 0.14391 seconds with 12 queries