.htaccess重写url以删除单个GET值

时间:2017-02-03 05:56:13

标签: php .htaccess url-rewriting

我正在尝试将我的网页重写为abc.com/profile.php?id=abcabc.com/abc

你可以指导我吗? 当我尝试添加以下行时,我收到500页错误

RewriteRule ^([^/]*)$ /profile.php?id=$1 [L]

我的htaccess

Options -Indexes
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]*)/([^/]*)/([^/]*)$ /detail.php?type=$1&title=$2&id=$3 [L]
RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?pn=$1&type=$2 [L]
RewriteRule ^contact-us.html$ contact-us.php [NC,L]
RewriteRule ^about-us.html$ /about-us.php [NC,L]
RewriteRule ^privacy-policy.html$ /privacy-policy.php [NC,L]
RewriteRule ^legal.html$ /legal.php [NC,L]
RewriteRule ^search$ /search.php [NC,L]
RewriteRule ^disclaimer.html$ /disclaimer.php [NC,L]
RewriteRule ^submit-job$ /submit-job.php [NC,L]

0 个答案:

没有答案