开发者

Apache Rewrite problems with my blog

I am having a hard time getting the rewrite rule setup correctly for my website&blog. Here is the current line in Apache's virtual host:

RewriteRule ^/(?:blog|apc|_em|phpsecinfo|blog/)/ - [L]

I am able to access my URL at www.domainname.com/blog/ But I am unable to access it at www.domainname.com/blog (without the ending /)

How can I edit my Rewrite rule s开发者_开发百科o that I can reach the blog without the ending / ? Thanks


This should help:

RewriteRule ^/(blog|apc|_em|phpsecinfo)$ /$1/ [R,L]
RewriteRule ^/(?:blog|apc|_em|phpsecinfo)/ - [L]


Add the ? modifier to whatever slash you want to make optional:

RewriteRule ^/(?:blog|apc|_em|phpsecinfo)/? - [L]
0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜