View Full Version : REGEX to detect long URLs

Lee Saw
08-12-2008, 03:00 PM

I have problems with long URLs because they break the design of my site.

Im looking for a regular expression to search in my entire site and detect URLs bigger than, say... 50 charaters in order to correct them beforehand.

Thanks :)

Lee Saw

08-12-2008, 03:17 PM
how many URL's have you got in there

if your dealing with allot then maybe worth sticking them in a table in a database

08-12-2008, 05:14 PM
This is done with url rewrite in a .htaccess file. They're called search engine friendly URL's.

This way you can make /page.php?cat=5&title=murder&page=1 to

Just an example

Lee Saw
08-12-2008, 07:36 PM
The ponit is this:

My site is huge, the content may have URLs in diferent parts, but I need to detect only the very long ones.

For example, with this Regex in the search panel I can have almost all the URLs : (http://www.)(.*?) (http://www.%29%28.*?%29)

But I get a huge list and its pretty useless to me that way :(


08-13-2008, 01:24 AM
I think you have to look at mod rewrite, check this link