2
我需要重寫url只有一個名爲gallery
的目錄。 我想有abc.com/photos/gallery/picture/
代替abc.com/photos/gallery/picture.php
只爲一個目錄刪除.php擴展名.htaccess?
.htaccess
index.php
/photos
/gallery
index.php
picture.php
functions.php
/videos
這裏是我的代碼.htaccess
,但它不工作。
RewriteEngine on
RewriteRule ^/[.*]/?$ photos/gallery/$1.php#{QUERY_STRING} [NC,L]
噢,它的偉大工程。謝謝@anubhava!除了我不得不將'gallery /'改成'photos/gallery /' – Steffi 2013-02-12 14:10:48
@Steffi:不客氣,我忽略了它是'/ photos/gallery'而不是'/ gallery' – anubhava 2013-02-12 14:21:51