LinuxQuestions.org
Support LQ: Use code LQ3 and save $3 on Domain Registration
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices

Reply
 
Search this Thread
Old 07-27-2010, 03:21 PM   #1
viGeek
LQ Newbie
 
Registered: Jul 2009
Posts: 28

Rep: Reputation: 17
Calling all Apache proxy/rewrite gurus


Trying to figure something out and looking for the best way to make it happen.

Working with a friend on a site, we're trying to do a rewrite or proxypass so that we can serve files from another directory at the root level.

i.e

We have website.com/directory/

In that directory are several files that fit the same naming scheme (i.e file1, file2, file3).

We are wanting to serve these files at the root directory but have them pulled from /directory/

Haven't done this before but have experienced working with Proxypass/Apache and mod_rewrite. My initial assumption was to try...

RewriteBase /directory
RewriteRule ^(.*)$ http://www.website.com/$1

(with options followssymlinks).

Does anyone have a good way to do this?
 
Old 07-27-2010, 06:52 PM   #2
bathory
Guru
 
Registered: Jun 2004
Location: Piraeus
Distribution: Slackware
Posts: 10,910

Rep: Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326Reputation: 1326
Hi,

Try this:
Code:
RewriteEngine on
RewriteCond %{REQUEST_URI} !^/directory/
RewriteRule (.*) /directory/$1 [L]
 
  


Reply


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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Apache virtual host, rewrite & proxy question NickDeGraeve Linux - Server 8 02-02-2009 07:09 PM
How do I get Apache Rewrite to proxy two domains ? MisterFine Linux - Server 1 11-28-2008 05:16 AM
Apache or cache proxy Gurus, please step in. orvtech.com Linux - Server 0 05-24-2007 02:27 PM
apache proxy server rewrite urls slackwarefan Linux - Software 0 10-19-2004 07:58 PM
calling any apache gurus Andy@DP General 2 09-12-2003 11:19 AM


All times are GMT -5. The time now is 05:28 AM.

Main Menu
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration