What's wrong with my RewriteRule via .htaccess? (Why does it need RewriteBase?)

前端 未结 2 623
rewriteengine on
rewriterule ^/a/b$ ^/c$

not working,but

rewriteengine on
rewritebase /
rewriterule ^a/b$ ^c$

wo

2条回答
  •  囚心锁ツ
    2021-01-05 13:51

    What version of Apache are you using? RewriteBase should not be necessary when you are rewriting from the root. If you are not, you may need it. For instance, a part of my current configurations (Apache 2.2) for one of my blogs looks as follows, and works:

    RewriteEngine On    
    RewriteRule ^/$ /blog/ [R]
    RewriteRule ^/wordpress/(.*) /blog/$1 [R]
    

提交回复
热议问题