开发者

Mod Rewrite 500 Internal Server Error Problem

I keep getting a 500 Internal Server Error when I try to change Example 1 to Example 2 using mod_rewrite. Can someone help me fix this problem?

Example 1

http://www.example.com/posts/1/abcd

Example 2

http://www.example.com/posts.php?aid=$1

Here is my mod rewrite.

<IfModule mod_rewrite.c>
Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} ^example\.com$ [NC]
RewriteRule ^(.*)$ http://www.example.com/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http:开发者_如何学C//www.example.com/ [R=301,L]
RewriteRule ^(-[1-9]+)? $ http://www.example.com/posts.php?aid=$1 [L]
</IfModule>


Try changing your last RewriteRule to something like this:

RewriteRule   ^([A-Za-z0-9-]+)/?$ http://www.example.com/posts.php?aid=$1 [L]
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜