There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Software Development
Tag Cloud
audio blue screen boot bsod computer cpu crash dell desktop driver drivers error excel external hard drive firefox freezes freezing hard drive hardware hijackthis internet internet explorer itunes laptop mac malware motherboard mouse network networking outlook 2007 power printer problem ram router screen slow sound trojan usb virus vista vista 32-bit windows windows vista windows xp winxp wireless wmp
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Software & Hardware > Software Development >
htaccess Rewrite fake folder to folder in cgi-bin


Computer problem? Tech Support Guy is completely free -- paid for by advertisers and donations. Click here to join today! If you're new to Tech Support Guy, we highly recommend that you visit our Guide for New Members. Enjoy!

Closed Thread
 
Thread Tools
SecretAgentW's Avatar
Senior Member with 137 posts.
 
Join Date: Jul 2003
Location: Texas, USA
28-May-2004, 08:49 PM #1
Exclamation [solved]htaccess Rewrite fake folder to folder in cgi-bin
Ok, guys I have literally worked on this problem for 5 hours now.

This is the structure of a perl program I want to use:

cig-bin/proggy/

And I want my users to see:

/proggy


Which is fine, but I have run into a snag. There are two programs in that directory.

mainproggy.pl
adminproggy.pl

Each one runs independantly. The problem lies is when I get a successful rewrite of mainproggy.pl, it kills adminproggy.pl when I try to run it (redirects it to mainproggy.pl). I really don't give a damn if I have to go to the ugly url cgi-bin/proggy/ to run the admin end - but I can't get them independant of each other (program's settings for web url and other stuff are shared in a common config file for both the main and the admin - I won't be able to update mainproggy on the fly using adminprogggy if I make 2 config files).

Every single resource and tutorial out there give me instructions on how to forward an entire directory to a specific file - but I can't figure out how to forward the entire directory to another directory.

Examples of what I have tried (some may cause but please keep in mind I was desperate to get it to work.) I put the .htaccess file in the /proggy/ directory:

Code:
RewriteEngine on
RewriteRule ^/?(.*)$ /cgi-bin/proggy/index.pl$1
Code:
DirectoryIndex index.pl
RewriteEngine on
RewriteRule ^/index\.pl(.*)$ /cgi-bin/proggy/index.pl$1
Code:
RewriteEngine on
RewriteCond  %{REQUEST_URI} !adminproggy.pl
RewriteRule ^/(.*)$ /cgi-bin/proggy/index.pl$1
Oh, and all sorts of others, but I figure this is enough.

Help.
__________________
SecretAgentWoman

Last edited by SecretAgentW : 28-May-2004 09:14 PM.
SecretAgentW's Avatar
Senior Member with 137 posts.
 
Join Date: Jul 2003
Location: Texas, USA
28-May-2004, 09:14 PM #2
Good lord, I got it!!!

Code:
RewriteEngine on
RewriteRule ^/?(.*)$ /cgi-bin/proggy/$1
I could have SWORN I already tried this, but I must have had an error in my syntax before.

Well, sometimes it takes showing it to the world for you to see it yourself.
Closed Thread

THIS THREAD HAS EXPIRED.
Are you having the same problem? We have volunteers ready to answer your question, but first you'll have to join for free. Need help getting started? Check out our Welcome Guide.


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
WELCOME TO TECH SUPPORT GUY! Are you looking for the solution to your computer problem? Join our site today to ask your question -- for free! Our site is run completely by volunteers who want to help you solve your computer problems. See our Welcome Guide to get started.



Thread Tools


You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 08:21 AM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.