首页 文章

htaccess url为博客重写规则

提问于
浏览
-1

嗨,我的htaccess url rewirte规则有问题,我想重写以下网址

http://myhomepage.com/agb.htmlhttp://myhomepage.com/agb

http://myhomepage.com//blog.php?archiv=webdesign-templateshttp://myhomepage.com/blog/webdesign-templates

这是我的实际.htaccess

Options +FollowSymLinks
RewriteEngine on

RewriteRule /blog/(.*) blog.php?archiv=$1

RewriteRule /kontakt kontakt.php

如何以正确的方式做到这一点请需要一些帮助伙伴 . 谢谢

1 回答

  • 1

    这应该适合你:

    RewriteEngine On
    RewriteBase /
    
    RewriteRule ^blog/([-a-zA-Z0-9]+)$ blog.php?archiv=$1 [L,QSA]
    RewriteRule ^blog/webdesign-templates/([-a-zA-Z0-9]+)$ blog.php?archiv=webdesign-templates&titel=$1 [L, QSA]
    RewriteRule ^kontakt$ kontakt.php [L, QSA] 
    RewriteRule ^([-a-zA-Z0-9]+)$ $1.html [L, QSA]
    

相关问题