|
|
Seo forumsSEO generalSEO scripts SEO tools Optimization Pagerank Dance Adsense Adwords Yahoo!NewsOptimization MicrosoftNewsOptimization MarketingCoop networkPromotion Affiliations Domain names Link popularity Link exchange Directories Buy & sell Services Freebies DevelopmentProgrammingServer issues Multimedia Javascript Databases Security HTML AJAX CSS PHP OtherSearch enginesTraffic ranking Robot spiders E-Commerce Site reviews Keywords Misc.WelcomeSuggestions Miscellaneous Register Membership Links Help About ![]() |
Regular expression to shorten URL
Hello to all... I have a small code problem, looking for a regular expression that would shorten URL changed in links (ie. ht*p://www.ficgs.com/looooooooooooongurl.html would appear ht*p://www.ficgs.com/looo...url.html .. Here is my regular expression : $url = preg_replace("#([\n ])?([hftp]+)://([a-z0-9-=_%\#$~%&;?./]+)#i", '\1<a href="\2://\3" target="_blank">\2://\3</a>', $url); Thanks in advance :) ficgs Suggestions corz.org/serv/tricks/htaccess2.php codex.gallery2.org/Gallery2:URL_Rewrite wareseeker.com/free-short-url-redirect/ ficgs More suggestions This is a collaborative page, you may change the order of these suggestions by registering, then clicking the icons before the titles. www.yourhtmlsource.com/sitemanagement/urlrewriting.html www.web-wise-wizard.com/javascript-tutorials/javascript-regular-expressions www.regular-expressions.info/ www.paulsonny.com/?p=18 www.vogella.de/articles/JavaRegularExpressions/article.html database-geek.com/2009/04/11/ora_tweet-now-does-short-urls/ community.nstalker.com/twitterfox-weird-behavior www.chazzuka.com/blog/?p=193 esev.com/blog/review/host-your-own-url-shortener-10-php-apps-reviewed/ answers.oreilly.com/topic/280-how-to-validate-urls-with-regular-expressions
[Games online]
[Last topics]
[Glossary]
[Help]
[Membership]
[About]
[Social network] [Hot news] [Discussions] [Seo forums] [Meet people] [Directory] |
|
![]()
You comment I follow : Links included in comments will be "dofollow" if your post is not an obvious spam, comments are published instantly. Write upside down to your contacts ! (works with Facebook, Twitter, MSN, Yahoo, MySpace, Hi5, Bebo, Youtube...) |