mod_rewrite: hayır?

0 Cevap php

What I'm trying to do: have pretty URLs in the format 'http://domain.tld/one/two/three', that get handled by a PHP script (index.php) by looking at the REQUEST_URI server variable.
In my example, the REQUEST_URI would be '/one/two/three'. (Btw., is this a good idea in general?)

I'm using Apache's mod_rewrite to achieve that.
Here's the RewriteRule I use in my .htaccess:

RewriteRule ^/?([a-zA-Z/]+)/?$ /index.php [NC,L]

Bu şimdiye kadar gerçekten iyi çalışıyor; Bu ileriye işlenmeden / index.php, AZ, AZ ya da '/' oluşur her REQUEST_URI.

Only drawback: '?' (question marks) and '#' (hash keys) seem to still be allowed in the REQUEST_URI, maybe even more characters that I've yet to find.
Is it possible to restrict those via my .htaccess and an adequate addition to the RewriteRule?

Teşekkürler!

0 Cevap