Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I am wanting to set up multiple rules, and so the system can be expanded I am wanting to use %{REQUEST_FILENAME} rather than having multiple rules set up.

My structure at the moment is:

/clients.php?view
/clients.php?view=1
/clients.php?view&add
/clients.php?remove=1
/memos.php?view=1

So there are multiple base pages (clients.php, memos.php, projects.php, client.php, project.php), and multiple query variables, that can be used in conjunction with one another, so you could have /clients.php?view=1&remove=1&add if you wanted to view a clients details as you remove them, and also have a form onscreen for adding, although generally that won't be done.

Is there a way this can be set up in htaccess, so it looks more like the following

/clients/view/
/clients/view/1/
/clients/view/add/
/clients/remove/1/
/memos/view/1/

Forgot to mention that currently I am just using the below .htaccess code, to remove .php from the url

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule (.*) $1.php [L]
share|improve this question

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.