2009-10-24 99 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的请求,并没有别的),所以这场比赛,所有的正则表达式(.*)是你所需要的。

相关问题