【发布时间】:2016-02-16 02:58:07
【问题描述】:
我想将我的网址更改为对搜索引擎友好。我在 64 位的 Windows 10 上使用 xampp 3.2.1 我的网址如下所示:
http://smc.edu.pk/app/site/?p=12&m=c&u=Swat_Medical_College-_The_Project_of_Swat_Medical_Complex
我想让它变成这样:
http://smc.edu.pk/app/site/12/c/Swat_Medical_College-_The_Project_of_Swat_Medical_Complex.html
我已经使用 .htaccess 测试了以下代码
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^/app/site/(\d+)/([a-z-]+)/(.+)\.html$ /?p=$1&m=$2&u=$3 [NC,L]
但是当我使用上面提到的第二个 url 时它返回以下错误:
Object not found!
The requested URL was not found on this server. If you entered the URL manually please check your spelling and try again.
If you think this is a server error, please contact the webmaster.
Error 404
smc.edu.pk
Apache/2.4.12 (Win32) OpenSSL/1.0.1l PHP/5.6.8
【问题讨论】:
标签: php apache .htaccess seo xampp