I have posted somewhat related to this topic here , but I seem not get the right answer. So could anyone help me to change the address like this:
example.com/index.php?page=something => example.com/something
and example.com/index.php => example.com
in the .htaccess file?
Here is my website link www.panhareach.com
Try this:
RewriteEngine on
RewriteCond %{QUERY_STRING} ^$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ([A-Za-z0-9\-]+)/?$ /index.php?page=$1 [L]
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.