apache2 mod_rewrite - Linux

Annie avatar
By Annie
at 2009-07-08T14:00

Table of Contents

一個 RewriteRule 可以搭配多個 RewriteCond 來多次判斷是否
執行 RewriteRule 的敘述, 因此, 只要在您原來的 RewriteCond
之前, 再多一個 "是否為 www.aaa.net" 判斷, 應可解決此問題.

如下所示.

※ 引述《todo2015 (土豆)》之銘言:
: 就是小弟有個網域 *.aaa.net
: 然後我希望每個使用者有兩種網址可以到達自己的目錄
: 例如: user.aaa.net 或是 www.aaa.net/~user
: 於是我寫了幾個rule
: <VirtualHost *:80>
: ServerAdmin webmaster@localhost
: ServerName *.aaa.net
: DocumentRoot /var/www/
: RewriteEngine on
RewriteCond %{HTTP_HOST} !=www.aaa.net
: RewriteCond "%{HTTP_HOST}" "^(user_reg_exp)\.aaa\.net$" [NC]
: RewriteRule "(.*)" "/nfs/%1" [L]
: ...
: </VirtualHost>
: 但這樣就發現
: 當要使用www.aaa.net/~user的時候
: apache會把www拿來parse
: 結果就變成導到/nfs/www了
: 請問要怎麼解決這個@@
: 謝謝!!

--
Tags: Linux

All Comments

Lauren avatar
By Lauren
at 2009-07-10T05:12
感謝!! 熊熊不知道有!=可以用..orz

SVN在post-commit裡如何顯示repository的名字????????????

Brianna avatar
By Brianna
at 2009-07-08T13:28
我設了讓commit完會寄mail的hook, 目前只會顯示path跟revision, ex: Author: machette Date: 2009-07-08 13:00:00 +0800 (Wed, 08 Jul 2009) New Revision: 425 Modified: ...

grub error 13 無法進入xp

Lucy avatar
By Lucy
at 2009-07-07T23:35
ubuntu幫我灌的grub xp選項無法進入xp 每次進去都顯示 error 13:invalid or unsupported executable format menu.lst下 windows xp選項內容如下: title windows xp root (hd0,0) savedefa ...

權限問題

Ingrid avatar
By Ingrid
at 2009-07-07T23:01
※ 引述《banband (祝福也是一種愛)》之銘言: : 想請教大大們 : 我利用 linux 主機架設一個網頁 : 誕 www 內的 .html 檔可以讀到 : 而 www 的上一層內容就讀不到了 : 就是沒有權限這樣 : 請問這個問題要怎麼解決呢 : 謝謝大家囉 -------------------- ...

apache2 mod_rewrite

Tristan Cohan avatar
By Tristan Cohan
at 2009-07-07T21:45
就是小弟有個網域 *.aaa.net 然後我希望每個使用者有兩種網址可以到達自己的目錄 例如: user.aaa.net 或是 www.aaa.net/~user 於是我寫了幾個rule andlt;VirtualHost *:80andgt; ServerAdmin webmaste ...

請問Linux Server如何改IP

Edwina avatar
By Edwina
at 2009-07-07T18:14
想請問一下各位高手, 公司有一台Linux server 他本身是mail server , DHCP , DNS 還負責了繞送內部公司的網路工作,算是一台小台的router 公司電腦網路要對外都得靠他 原本頻寬是2m的 但最近公司頻寬改換10m 所以原本有申請一組固定ip,現在也要改ip了 但我對linu ...