0
我想改變的東西像我htaccess文件無法正常工作的URL重寫
http://x.com/genre.php?type=action
to:
http://x.com/genre/action
或
http://x.com/genre.php?type=action&arg=tv
to
http://x.com/genre/action?tv
我嘗試過多種方法,但他們都沒有工作了我:
RewriteEngine On
RewriteRule ^genre.php?type=*$ /genre/$1 [R=301,L]
我覺得我正在談論這個完全錯誤的,有人可以照亮情況嗎?
我目前的htaccess文件只是從.php文件的末尾刪除.php文件,我成功從互聯網上的某些源文件中取出。
RewriteEngine On
# browser requests PHP
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^\ ]+)\.php
RewriteRule ^/?(.*)\.php$ /$1 [L,R=301]
# check to see if the request is for a PHP file:
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^/?(.*)$ /$1.php [L]
這不是爲我工作的;( – RazeByte