我使用下面的代碼...mod.rewrite多個規則同一目錄
#Fix Rewrite
Options -Multiviews
# Mod Rewrite
Options +FollowSymLinks
RewriteEngine On
RewriteBase/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)?$ index.php?q=$1 [L]
把www.website.com/index.php?q=Keyword
成www.website.com/Keyword
偉大的工程....但是....
我也(在同一目錄中)有一個名爲spec.php
的文件,它接受GET
變量eid
。
我還需要有一個轉www.website.com/spec.php?eid=00000
到www.website.com/00000
或www.website.com/spec/00000
無需實際移動spec.php
到子目錄中的規則。
任何幫助將非常感激,我的眼睛有谷歌燒傷。我發現有些做了類似的事情,但是當我嘗試將它與我的情況相匹配時,我遇到了問題。
「將」www.website.com/index.php?q = Keyword「變成」www.website.com/Keyword「:這應該是另一種方式,不是嗎? – ultranaut 2013-03-06 01:02:35