I have the URL
files.php?id=5
and the 5 is the ID of the row in my database(MySQL).
I have seen this be done other places where it is rewritten to
files/5/TITLE_Of_ROW
Is this with mod_rewrite or is this more of a PHP thing.
EDIT:
Hopefully this helps a little bit.
My .htaccess is
- Code: Select all
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ $1.php [L,QSA]
Options +FollowSymLinks
RewriteEngine on
RewriteRule details/id/(.*)/ details.php?id=$1
RewriteRule details/id/(.*) details.php?id=$1
The first few lines with comments I borrowed from a script for security purposes.
The first four lines starting with the RewriteRule ^ are to allow requests for index instead of index.php.
The last five lines I got from
http://www.webconfs.com/url-rewriting-tool.php
and when I try it, I get an error.
Is there something wrong with how it is layed out.
Thanks for any help
-NeXEA