1
我有一些困難,創建一個簡單的htaccess的URL重寫。.htaccess和重寫規則
我想是網址與3個參數:
www.example.com =>的index.php
www.example.com/module/ =>的index.php模塊= $ 1
www.example.com/module/action/ =>的index.php?模塊= $ 1 &行動= $ 16
www.example.com/module/action/1 =>的index.php ?模塊= $ 1 &行動= $ 16 & PARAMS = $ 3
我這樣做,有很多教程,但是當我嘗試用最後一個,它的失敗
RewriteRule ^web/([^/]*)$ index.php?module=$1 [L,QSA]
RewriteRule ^web/([^/]*)/(.*[^/])$ index.php?module=$1&action=$2 [L,QSA]
RewriteRule ^web/([^/]*)/(.*[^/])/([0-9]*)$ index.php?module=$1&action=$2¶ms=$3 [L,QSA]
有人能幫助我嗎?
感謝
BOUFFE
謝謝!我想我混合了一個URL重寫與正則表達式。* 我會讀更多的文檔 – Bouffe
我完全像'http://www.example.com/templates/professional_website/news.php?ac=post&id=2&p = 1',那我該如何實現呢?到'https://www.example.com/templates/professional_website/news/post/2/1' –