0
想像這樣一個URL:如何匹配mod_rewrite的MAC地址
http://hostname/a/b/xy-00:11:22:33:44:55-/c
我想提出一個.htaccess文件根並對其進行處理爲:
http://hostname/d.php,其中d.php真的存儲在文件系統中/home/user/d.php
我在.htaccess文件中有以下內容,但匹配沒有發生,即Apache說404 Not Found。
RewriteRule ^/a/b/xy-(.*)-/c$ ~user/d.php [NE]
關於如何使這項工作的任何想法?
文件系統佈局:
\
+etc
| +apache2
| +httpd.conf
| +extra
| | +httpd-userdir.conf
| +users
| +user.conf
+Library
| +WebServer
| +Documents
| +index.html.en
| +info.php
+Users
+user
+Sites
+d.php
相關/etc/apache2/httpd.conf剪斷(在MacOS X的獅子):
DocumentRoot "/Library/WebServer/Documents"
<Directory />
Options FollowSymLinks
AllowOverride None
Order deny,allow
Deny from all
</Directory>
<Directory "/Library/WebServer/Documents">
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Order allow,deny
Allow from all
</Directory>
/Library/WebServer/Documents/.htaccess:
RewriteRule ^/a/b/xy-(.*)-/c$ ~user/d.php [NE]
這樣做,非常感謝。 – HanSooloo 2012-03-18 00:02:39