var uri = new Uri(url);
var relurl = uri.Scheme + "://" + uri.Authority;
foreach (var v in uri.Segments.Take(uri.Segments.Count() - 1)) { relurl += v; }

C# Get base without file/path

by acidzombie24.myopenid.com, June 29, 2011 22:27, 2 refactorings, tagged with url
55502f40dc8b7c769880b10874abc9d0 Talk
module Rack
    class Request
      def subdomains
...

Ruby Personalized URL (Purl) Sub...

by grayfm, January 11, 2010 22:25, 4 refactorings, tagged with url, rack, domain, sinatra, subdomain

So i need to define @purl_b...

41b76a0d9fd81133d545fb2b994013ab Talk
<?php
    function isvalid_url($url) 
    {
...

PHP check for valid url

by armano.myopenid.com, December 15, 2008 02:25, 15 refactorings, tagged with url

Hi everyone..is there other...

1cd9c8984f2fdeb996130d54d62a98d9 Talk
<?php
/*
E.g:
...

PHP remove http from url string

by armano.myopenid.com, November 11, 2008 04:09, 15 refactorings, tagged with url, short url, remove http

Ive made a function simply ...

1cd9c8984f2fdeb996130d54d62a98d9 Talk
function create_link($string) {

		$input = media_title($string);
...

PHP Prepare links - friendly URLs

by Memf, September 04, 2008 05:57, 2 refactorings, tagged with create link, links, memf, function, memforis, code, prepare, URLs, url, friendly urls, friendly, short, php

Please help shorten the cod...

71367d98df2bf14cbf704e7741eb402d Talk
# This method searches a source by  the http, the www and the trailing / to a url
	def self.find_by_url(url)
		Source.find :first, :conditions => [ " url = ? OR url = ? OR url = ? OR url = ? ", url, url.gsub("http://", "http://www"), url + "/", url.gsub("http://", "http://www")+"/"] 
...

Ruby Find a URL in a database

by julien, July 18, 2008 17:16, 3 refactorings, tagged with url, find

Hi!
I've a got a website A...

B30ce50678f0e934eaa6697425c59dd7 Talk
<? php
if $userinput = "http://www."
{
...

PHP Replace user input with link

by Mlopez, January 02, 2008 01:39, 28 refactorings, tagged with http, parsing, phrasing, help, user, php, url, with, text, replace

im not quite sure where to ...

132a00e84e74c003f68311b39b28e969 Talk
<script type="text/javascript">

window.onload = function() {
...

JavaScript Shorten links

by DeathfireD, November 09, 2007 14:23, 6 refactorings, tagged with url, short, short url

is there a better, shorter,...

421453710d51d7daaea8069af0aa4126 Talk
<script type="text/javascript">
var feature_stuff = new Array(
'<li><a href="#">URL 1</a></li>',
...

JavaScript Random URL

by DeathfireD, October 29, 2007 15:21, 7 refactorings, tagged with random, url, math

Outputs one of the 5 urls r...

421453710d51d7daaea8069af0aa4126 Talk