How to map all requests to a single file?

Asked

Viewed 95 times

0

I need to map all requests that arrive to the server as follows:

exemplo.com/joao  =>  exemplo.com/index.pl?u=joao
exemplo.com/joao/ =>  exemplo.com/index.pl?u=joao

My file /var/www/.htaccess is like this so far:

RewriteEngine On
RewriteRule ^([a-zA-Z0-9\_\-]+)\/?$ index.pl?u=$1

In normal cases the rule works. But it fails in the case of the directory /var/www/joao exist.

I need the URL to be transformed even if the directory joao exists. Anyone has any idea?

1 answer

-1

Very good. now I have a web server and another application server running jboss. my requests go through the web server. wanted to make url friendly but ta giving error

Browser other questions tagged

You are not signed in. Login or sign up in order to post.