你好,我想創造清潔網址如何創建網址乾淨的URL與尋呼
這樣 http://localhost:8081/olshop/products/category/[namecategory]/[paggingnumber]
例如:http://localhost:8081/olshop/products/category/pants/1
這是我的.htaccess
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule index$ index.php [L]
RewriteRule ^products/category/([^/]+)/?$ index.php?p=products&category=$1 [L]
RewriteRule ^products/category/(.*)\/(\d+)\$ index.php?p=products&category=$1&page=$2 [L]
RewriteRule ^detail/([^/]+)/?$ index.php?p=detail_product&link_barang=$1 [L]
RewriteRule ^([^/.]+)/?$ index.php?p=$1 [QSA,L]
</IfModule>
當我試試像
http://localhost:8081/olshop/products/category/pants/
這項工作
但不使用分頁(404未找到) http://localhost:8081/olshop/products/category/pants/1
幫助時,工作 我感謝的:)
你需要把規則的分頁上面的規則沒有分頁。 –
當我嘗試鏈接不乾淨的url,這項工作並沒有問題 的http://本地主機:8081/olshop/index.php的P =產品和類別=褲子&頁= 1 但在使用乾淨的URL不行我 HTTP://localhost:8081/olshop/products/category/pants/1 我認爲我的代碼是錯誤的.htaccess –
你是什麼意思「不工作」?請更具體的 – starkeen