-1

i want to set my index with variable..like example localhost/sitename i want it to be localhost/sitename/index.php?variable=value ^^ anyone could help

4

1 回答 1

1

You need to create an .htaccess file in your webroot directory, and then inside put:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?uri=$1 [L,QSA]

Remove the middle 2 lines if you don't want direct access to valid directories/files.

于 2013-01-08T00:58:44.410 回答