Apache Mod Rewrite for Pretty URLs isn't working

后端 未结 4 538
你的背包
你的背包 2021-01-15 02:13

I\'m trying to figure out how to do an apache mod_rewrite to remap $_GET.

What I\'m trying to accomplish:

Currentl

4条回答
  •  暗喜
    暗喜 (楼主)
    2021-01-15 02:44

    You could try this:

    RewriteRule ^/([a-z0-9_-]{1,40})/?$ index.php?URL=pages/$1.php
    

    Though ideally you might want to get rid of the "pages/" part of the query string variable, as this fixed constant could be handled by the index.php script.

提交回复
热议问题