2009-10-24 37 views
0

我正在使用一個正則表達式來匹配URL,但沒有在開始時使用http,httpsftp。基本上,我需要它的mod_rewrite:需要一個正則表達式來匹配URL(不包含http,https,ftp)

例子:

www.someurl.com/blah/blah/balh/etc/and/so/on 
crazy.something.net/agjja 
something.us/index.php? 

所以,我能做的

RewriteCond %{REQUEST_URI} URLregexhere 
RewriteRule ^URLregexhere$ ping.php?url=$1 [L] 
+0

Duplicate:http://stackoverflow.com/questions/1616770/help-rewriting-this-url-simple-but-not-working – Gumbo

回答

0

要匹配一切嗎?

RewriteCond %{REQUEST_URI} !^/?ping\.php 
RewriteRule (.*) ping.php?url=$1 
0

通過在一個重寫規則的正則表達式是接收定義一切都是一個URL(因爲它的美聯儲的URL的請求,並沒有別的),所以這場比賽,所有的正則表達式(.*)是你所需要的。

相關問題