url

How SEO friendly is Unicode URL?

As the title says, how SEO friendly is a URL containing Unicode characters. Edit: To clarify, I meant URL with non-ASCII characters but valid Unicode. ...

Can a URL contain a semi-colon?

I am using a regular expression to convert plain text URL to clickable links. @(https?://([-\w\.]+)+(:\d+)?(/([\w/_\.-]*(\?\S+)?)?)?)@ However, sometimes in the text, URL are enumerated one per line with a semi-colon at the end. The real URL does not contain any ";". http://www.aaa.org/pressdetail.asp?PRESS_REL_ID=275; http://www.aaa....

Alternatives to using WebClient.BaseAddress to get base url in Silverlight

In a Silverlight application I sometimes need to connect to the web site where the application is hosted. To avoid hard coding the web site in my Silverlight application I use code like this: WebClient webClient = new WebClient(); Uri baseUri = new Uri(webClient.BaseAddress); UriBuilder uriBuilder = new UriBuilder(baseUri.Scheme, baseUr...

Simple URI rewrite with .htaccess

My current .htaccess file Options +FollowSymLinks RewriteEngine on RewriteCond %{HTTP_HOST} . RewriteCond %{HTTP_HOST} !^falsebase\.net RewriteRule (.*) http://falsebase.net/$1 [R=301,L] I want to add on to this so I when a user enters "http://u.falsebase.net/USERNAME" into their address bar they get directed to "http://falsebase.net...

Getting the referrer URL in php ( including parameters )

Are there any HTTP Headers I could use to grab the entire referrer URL using a webserver/server-side scripting? Including query string, et cetera? ...

To understand a line about a login -variable in a session

What does the following line mean? Put the boolean variable isLogin to your session such that you check the session each time your user goes to the secured site. I would like to know how you can put a variable to a session. I know at the abstract level that session is a semi-permanent interactive information interchange, al...

ASP.NET MVC, Url Routing: Maximum Path (URL) Length

The Scenario I have an application where we took the good old query string URL structure: ?x=1&y=2&z=3&a=4&b=5&c=6 and changed it into a path structure: /x/1/y/2/z/3/a/4/b/5/c/6 We're using ASP.NET MVC and (naturally) ASP.NET routing. The Problem The problem is that our parameters are dynamic, and there is (theoretically) no lim...

Truncating Query String & Returning Clean URL C# ASP.net

I would like to take the original URL, truncate the query string parameters, and return a cleaned up version of the URL. I would like it to occur across the whole application, so performing through the global.asax would be ideal. Also, I think a 301 redirect would be in order as well. ie. in: www.website.com/default.aspx?utm_source=twi...

Replace URLs in text with HTML links

Here is a design though: For example is I put a link such as http://example.com in textarea. How do I get PHP to detect it’s a http:// link and then print it as print "<a href='htttp://example.com'>http://example.com&lt;/a&gt;"; I remember doing something like this before however, it was not fool proof it kept breaking for compl...

What is the maximum length a URL can be to be opened in a J2ME browser?

What is the maximum length URL? This is may be handset dependent; on a desktop, it is definitely browser dependent, as discussed in this question. I am interested in specifications or references as much as empirical data. My particular usecase is passing a very long (about 1600 character) URL to a MIDlet.platformRequest(String url), w...

How to Get Form Field Value, Then Use to "Stuff" URLs Behind Buttons?

On my PHP web page, I want to have an input field where the user can enter a web address. I want to do a quick validation to make sure it actually looks like a web address. If good, I want to append that web address to the URL behind some buttons the user can click. For example, maybe I want to create something that lets the user en...

How to parse a URL in C?

Hi, Im wondering how to parse a url into an URL object(of some kind) in C. So that I would be able to extract key/val objects from a querystring. Have looked at: http://stackoverflow.com/questions/726122/best-ways-of-parsing-a-url-using-c And several other resources, even Google Code, but haven't found anything in my taste.. And no, u...

Extract filename and path from URL in bash script

In my bash script I need to extract just the path from the given URL. For example, from the variable containing string: http://login:[email protected]/one/more/dir/file.exe?a=sth&amp;b=sth I want to extract to some other variable only the: /one/more/dir/file.exe part. Of course login, password, filename and parameters are optional...

How do I create a separate directory for each video in a database and pull its ID from the URL?

For example - on vimeo.com, each video has an id number. To view that video, you simply navigate to vimeo.com/2847535 or whatever. Let's say I have a similar site where every time a user adds a video, it is assigned a unique id. How do I create a directory with that ID number after I add the video to the database? Also, once the video...

Redirect to older page in php?

Lets say, user go to "profile.php" page, but it requires login. Then it redirects to login page. But after login, it should redirect back to profile.php page. How do i do that? How to get current URL in php? $_SERVER['URI']???? ...

quick question: how to set *.domainname.com url in django

Hello all, I know there are lots of example for how to set http://domainname.com/username url. But how to set http://username.domainname.com url in django? Thinking a way to have a unique url for each user as http://username.domain.com like http://garry.posterous.com/ Thanks ...

In a URL Should spaces be encoded using %20 or +?

In a URL that used to request an image on a page (in this case a tracking image) should I encode the spaces using %20 or +. i.e. www.mydomain.com?type=xbox%20360 or www.mydomain.com?type=xbox+360 Our tracking company is expecting the top version, but the Java method URLEncoder.encode("xbox 360","UTF-8") gives the bottom version. Wh...

Is this code vulnerable to hacker attack?

Hi all, I am really new to online web application. I am using php, I got this code: if(isset($_GET['return']) && !empty($_GET['return'])){ return = $_GET['return']; header("Location: ./index.php?" . $return); } else { header("Location: ./index.php"); } the $return variable is URL variable which can be easily changed by hacker. E...

Emulate appearance of a link with javascript

Hi, I need to open links with javascript (window.open) when the user clicks on positions in a google-maps map. How do I make the user understand that it is a link, that he can click it, and where he will end up when he has clicked it? Among other things, while the user is hovering over a map position, the URL of that position should b...

How can I get the root domain URI in ASP.NET?

Let's say I'm hosting a website at http://www.foobar.com. Is there a way I can programmatically ascertain "http://www.foobar.com/" in my code behind (i.e. without having to hardcode it in my web config)? ...