go ahead... be a heretic | |
PerlMonks |
using htaccess to call a perl scriptby keiusui (Monk) |
on Feb 26, 2010 at 23:56 UTC ( [id://825603]=perlquestion: print w/replies, xml ) | Need Help?? |
keiusui has asked for the wisdom of the Perl Monks concerning the following question:
Hello, I am currently using a RewriteRule in htaccess to internally call a Perl script. It works very well for making URLs search engine friendly. For example, when a user goes to:
http://www.mydomain.com/Bill_Gates They are looking at information about Bill Gates, but they are really calling a script like: http://www.mydomain.com/cgi-bin/display.pl?name=Bill_Gates The RewriteRule looks like this: RewriteRule ^([^/]+)?$ /cgi-bin/display.cgi?name=$1 [L] This works well, but the htaccess also treats "http://www.mydomain.com/cgi-bin" as a username rediecting it to "http://www.mydomain.com/cgi-bin/display.cgi?name=cgi-bin". How would I write the RewriteRule so that it calls the Perl script in all cases except when the username is "cgi-bin", "images", or some other common directory, while still treating names like "Bill_Gates" or "Steve_Jobs" as usernames? Thanks in advance for any help on this.
Back to
Seekers of Perl Wisdom
|
|