proxying content of a directory depend on string in URI

New to mod_rewrite? This is a good place to start.

proxying content of a directory depend on string in URI

Postby BMN » Wed Oct 13, 2010 11:46 am

I'm trying to solve quite simple problem, but I can't force proxying it to work.
It's about changing path to admin panel of a cms system.

Mine setup
admin panel (I know how to block direct access to admin url)

Problem: I'd like to access admin panel from another directory, let's say testpanel (

I've created testpanel directory, and placed there below rewrite rules
Code: Select all
RewriteEngine On
RewriteCond %{REQUEST_URI} =/testpanel/
RewriteRule ^(.*)$$1 [P,L]

I can't say it doesn't work, but it isn't proxying img, and css files from the admin directory, thus I'm getting only processed index.php file, and nothing more (can't process login, because it doesn't proxy all needed files).

Adding files and directories as rewrite conditions
Code: Select all
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

doesn't solve the problem, and leads to northing.

I think I should add QSA parameter, but I have no idea how should I set up the rewrite rule to make it working.

ps. I'm trying to set up an additional method of securing access to admin panel using only mod rewrite, for users who don't have access to shell on their servers.

pps. browsing whole interwebz didn't give any solution :(
Posts: 39
Joined: Wed Jul 05, 2006 2:15 am

Return to Beginner's Corner

Who is online

Users browsing this forum: No registered users and 8 guests