Welcome Guest, Not a member yet? Register   Sign In
URI routing regexp
#1

Hi there.
Well I've been enjoying CI for a few years now but I still havent got the hang of using regexp in my URI routing in routes.php
I was hoping for a bit of help if possible.

I am trying to route all requests for URI's that contain another URL.
For example:


http://mysite.com/http://www.google.com
http://mysite.com/www.google.com
http://mysite.com/google.com


the $_SERVER['REQUEST_URI'] would be like:
/http://www.google.com

I was using:
$route['^(http.*|www.*)']
but this doesn't catch the 3rd example

I'm wondering if I should either use one of those very long regexp's that look for a valid url and allow for the proceeding forward slash.

Another idea was to look for a period ('.'), But I didnt want http://mysite.com/file.txt to match.

If anyone could help with this expression I really would be very grateful. I could even send a few dollars. I've been trying to fix this for days (and nights)

-Tim
Reply


Messages In This Thread
URI routing regexp - by timfelix - 12-21-2016, 02:03 PM
RE: URI routing regexp - by PaulD - 12-21-2016, 06:05 PM
RE: URI routing regexp - by timfelix - 12-21-2016, 06:26 PM



Theme © iAndrew 2016 - Forum software by © MyBB