PDA

View Full Version : REGEX to detect long URLs


Lee Saw
08-12-2008, 04:00 PM
Hello:

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

davidj
08-12-2008, 04: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

domedia
08-12-2008, 06: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
/murder/1/

Just an example

Lee Saw
08-12-2008, 08: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 :(

Thanx

edbr
08-13-2008, 02:24 AM
I think you have to look at mod rewrite, check this link
http://www.mod-rewrite-wizard.com/