Hi all and thanks ahead of time, I am attempting to give a url like a parameter but I am unable to. My rule is:

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^info/([a-zA-Z0-9|]+)/(.*)/(.*)$ info.php?user=$1&text=$2&url=$3

Within the browser: http://localhost/example/info/peter/hi guy/http://www.example.com

Return array $_GET php

[user] => peter
[text] => hi guy / http:
[url] => www.example.com

An amount be correct:

[user] => peter
[text] => hi guy
[url] => http://www.example.com

I really hope your help thanks

It's known as greedy matching .. the "us dot-asterisk" matches around it may &lifier then backtracks. Rather use [^/] that will match up with the following slash.

RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f  
RewriteCond %{REQUEST_FILENAME} !-d  
RewriteRule ^info/([a-zA-Z0-9|]+)/([^/]*)/(.*)$ info.php?user=$1&text=$2&url=$3 [B,QSA]

[^/] means "any character that isn't a slash". Naturally which means that "text" cannot contain any slashes, however your URL is going to be matched up properly.

Also note the [B] which is just one of several choices you can include to some rewrite rule. [B] implies that any &s plus some other figures is going to be steered clear of. Therefore if the URL that you are like a parameter includes a query string, it may be read in $_GET['url'] where its parameters would certainly be interepreted included in the new query string.

Not my specialization, why not make use of a $_SERVER request the url?

It might work, might not, which way when the domain ever changes then there's you don't need to update anything.

Hope this can help.

http://localhost/example/info/peter/hi/guy/http://www.example.com isn't a valid URL for which you are attempting to do. The URL part ought to be urlencoded. See this explanation, for instance.

The right URL could be:


Nothwithstanding this time, the mistake together with your regex is greedy matching as referred to in another answer. If however you encoded the URL properly, that would not be an issue.