» Home » urls » Page 1
Hierarchical RESTful urls still preferred - in terms of added overhead - over flat urls?
by Techhog in Coding

Let's say I have a website where users can upload and show their pictures. A RESTful url to a single picture of that user would look like:


http://api.gallery.com/users/{user-id}/images/{image-id}

But the image-id itself is already unique, so this url would already be good enough to get it:


http://api.gallery.com/images/{image-id}

Friendly URLs with .htacces NOT working… and stackoverflow URLs style
by Christopher Harris in Development Tools & Services

I know this question has been asked a million of times here at stackoverflow, but I cant get it to work so I need someone who knows to finally resolve this problem!


I want that when this is inserted in the URL:


http://website.com/pelicula/0221889/
http://website.com/pelicula/0221889/posters/

It really goes to this:


http://websi

Redirect all naked domain urls to subdomain(www) urls preserving the url, except for one page on IIS/ASP.NET
by tommy in Programming Languages

Whats the best way to achieve the above? I do know that it can be achieved at HttpModule level. Is it possible just via web.config(easier and faster to code execute).


Forcing the rewriting of URLs by hiding .php AND .htm(l) extensions and redirecting to extensionless URLs
by debuke in Web Design

here is my configuration:


http://domain.com (obviously fictitious name...) hosted on a server running Apache with mod_rewrite enabled
folder named "foo": (located at http://domain.com/foo/ and in which I want to put my .htaccess file) containing only 3 types of files .php, .htm, .html
.php files (for the sake of the example I will refer to one of them: phpfile.php)
.htm

Redirect/.htaccess to change old PHP parameter URLs to SEO friendly CakePHP URLs?
by cbrunny in PHP

I'm about to update my site to use CakePHP instead of an old homegrown framework. I need to write the HTAccess file to redirect the old PHP parameter URLs to the new CakePHP SEO friendly urls, but I can't get it to work.


My htacess file (the one in app/webroot) looks like this at the moment:


RewriteEngine On
RewriteRule ^index.php?action=view&item=172$ inde

In Perl, how can I replace relative URLs in src attributes of img tags with absolute URLs?
by YooperDave in Programming Languages

I want to find and replace (from an html page) all occurrences of src attributes in img tags. E.g., take


<img width="25" height="13" border="0" src="/images/flags/de.png">

and change the src attribute


I am currently using:


$info{content}=~s!(<img[^>]src=")(/.*)"!$http://$dest$2!gi;<

javascript : extract http urls from a string of multiple urls
by AnToni00 in Programming Languages

I have a huge string of multiple URLs in javascript which is of the following format:


var urls = "http://..... , http://..... , http://......"

I need to extract all URLs from the string into individual variables of part of an array. I cant do a urls.split(",") as some urls seem to have commas in them.Is there a good regex I can use to solve this problem ?


How to 301 redirect from old query string urls to CakePHP Canonical urls?
by jmccliment in Web Design

I currently have a .htaccess file that looks like this:


RewriteCond %{QUERY_STRING} ^action=view&item=([0-9]+)$
RewriteRule ^index.php$ /index.php?url=item/%1 [R=301]
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]

It is meant to 301 redirect my old query string based


Keep track of reserved URLs (to enable vanity per-user URLs)
by Mcad in Programming Languages

On my rap lyrics explanation website, every user has an associated "favorites" page at http://rapgenius.com/USERNAME


Because these favorites pages occupy the root namespace, I have to make sure that no one takes a username that I'm already using for something else. E.g.:


/songs
/lyrics
/users
/posts
Parse text to format URLs from content and shorten URLs
by stephenbennyhat in Web Design

I would like to parse the following text into formatted URLs with anchor tags:


something is wrong with http://www.gbin1.com/index.html, but cannot find the reason in http://www.google.com

How can I replace the text URLs above with <a href="url">url</a> and also shorten it using JavaScript as displayed below:


something

Next
Privacy Policy - Copyrights Notice - Feedback - Report Violation - RSS 2017 © bighow.org All Rights Reserved .