LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Linux - Server (http://www.linuxquestions.org/questions/linux-server-73/)
-   -   Calling all Apache proxy/rewrite gurus (http://www.linuxquestions.org/questions/linux-server-73/calling-all-apache-proxy-rewrite-gurus-822485/)

viGeek 07-27-2010 04:21 PM

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?

bathory 07-27-2010 07:52 PM

Hi,

Try this:
Code:

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



All times are GMT -5. The time now is 08:22 PM.