所以我想从 .htaccess 文件中得到通常的东西。www.example.com/article.php?title=my_title 应该替换为 www.example.com/article/my_title,但是我似乎无法让它工作。截至目前,我可以让 .php 删除,我怀疑这可能是一些问题。(我也得到http://example.com去http://www.example.com)这是我的 .htaccess 文件
Options +FollowSymLinks -MultiViews
rewriteengine on
## this is the piece that is not working
RewriteRule ^title/(.*) article.php?arr=title/$1
rewritecond %{HTTP_HOST} ^example.com$
rewriterule ^example\/(.*)$ "http\:\/\/www\.example\.com\/$1" [R=301]
RewriteBase /
## Hide .php extension
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f
RewriteRule ^ %{REQUEST_URI}.php [L]
## Error document (needs to have a 404 page created)
ErrorDocument 404 http://www.example.com/