url

A better way to validate URL in C# than try-catch?

I'm building an application to retreive an image from internet. Even though it works fine, it is slow (on wrong given URL) when using try-catch statements in the application. (1) Is this the best way to verify URL and handle wrong input - or should I use Regex (or some other method) instead? (2) Why does the application try to find im...

User View Profile

Hi All, I am building an application for my client and I am not using any frameworks . Question came up when building viewing user profile My client wants to see the user profile URL like mywebsite.com/Johnd - should give Johnd profile mywebsite.com/KJohns - should give KJohns profile I have implemented URL mapping like http:/...

Given protocol, username, password, hostname, port and path how to get a URL

Given protocol, username, password, hostname, port and path what is the easiest way to get a (properly encoded) URL There are similar questions already asked but: java.net.URI seems to not allow to pass the password java.net.URLEncoder makes me split the path into components and encode each ...

Can I attach a login form's username into the URL as a query string parameter?

I have a standard Login form <asp:Login ID="lgnExcel" DestinationPageUrl="login/data.aspx" OnAuthenticate="Login1_Authenticate" runat="server"> Is it possible to attach the Username as a query string with the DestinationPageUrl or reference the value in the code behind. I've tried lgnExcel.UserName.ToString() but coudldn't get to sho...

How to determine the file extension of a file from a uri

Assuming I am given a URI, and I want to find the file extension of the file that is returned, what do I have to do in Java. For example the file at http://www.daml.org/2001/08/baseball/baseball-ont is http://www.daml.org/2001/08/baseball/baseball-ont.owl When I do URI uri = new URI(address); URL url = uri.toURL(); Strin...

Subdirectory on a different host

I've got a site www.example.com on one server. I'd like to create www.example.com/blog on another server/host. A) Can I do this? B) How can I do this? I've read a bit on using Apache's mod_proxy, proxypass, and ProxyPassReverse, but I'm not gifted enough with Apache or server mgt to know if I'm on the right track or not. Or, if there...

Distinguishing User Profile Pages from Content Pages

I'm managing the implementation of Single Sign-On functionality into a suite of websites and want to create the best possible solution for our users. I would prefer that each user get a Profile Page that has the URL format: http://website/&lt;username&gt; But I also need to deliver content from that location, for example: http://web...

how to fetch url containg '#' in it by php ??

Possible Duplicate: retrieve the hash in the url with php? iam having a page that is containg bookmark in its url like http://www.abc.com/page_url#bookmark iam using $_SERVER['HTTP_HOST'] and $_SERVER["REQUEST_URI"] to get the url but its gigvng URL only upto http://www.abc.com/page_url i.e. its not giving my bookmarked lin...

jQuery.url plugin not working from within click handler function

I'm trying to use the jQuery.url plugin (http://projects.allmarkedup.com/jquery_url_parser/) to grab a specific parameter from the query string of a url of an anchor which has just been clicked on, like so: HTML: <a class="clickonme" href="http://www.example.com/my/url/params?myparam=ABC123"&gt;Link text</a> JavaScript: var myPa...

nginx conf does not use my defined location rules

When users come to / they should be served a static index.html file. When they come to /foobar the request should be sent to the backend server. However, this is not the case, with the following: pid logs/nginx.pid; worker_processes 2; events { worker_connections 1024; } http { include mime.types; de...

Url routing errors in php in codeigniter

My login form on front page is displayed, but when it posts to other pages, the post does not happen. THe problem is that the url is like: http://sitename/users/action which is a 404 not found url. But when i hard code the path to controller, (that is, stop using base_url + "/users/action" and use base_url + "/system/application/controll...

Parse string to get an array of the URLs

Hi, Imagine I have a string - something like this: This is some really cool text about http://google.com/ and it also contains some urls like http://apple.com/ and its very nice! This is too long and I need to do some magic stuff to fix this very big problem. Oh no. As you can see there are two URLs in the string and somehow, assumin...

How to use SEO urls in CakePHP without the ID?

Hello, Is there a simple way to route my URLs without showing the ID in the URL. For example i have: www.mywebsite.com/id-article-title.html and i want only www.mywebsite.com/article-title.html Regards ...

parse url from string in coldfusion

i need to parse all urls from a paragraph(string) eg. "check out this site google.com and don't forget to see this too bing.com/maps" it should return "google.com and bing.com/maps" i'm currently using this and its not to perfection. reMatch("(^|\s)[^\s@]+\.[^\s@\?\/]{2,5}((\?|\/)\S*)?",mystring) thanks ...

Best way to implement a Web 2.0 navigation system

Now here is my situation: I'm making a CMS. When links are clicked, i would like the pages to load dynamically using Ajax. The problem in the links! The only way to change the address in the address bar real-time is to use anchor tags. But PHP doesn't get the anchor tags, thus I can't load page content on site load using PHP. And if i w...

Previous/Next Web Page Links Heuristics?

I'm looking for a list of heuristics, given an HTML document and/or a set of URLs on a web page, that will give a set of URLs that are previous/next links from that page. Also, assume that you are given the base URL. I do not require to know if a link is specifically a next or previous URL, just that it is one of those two. I've got a...

How to append URL in java

Hi, Do you know any JDK service in Java 1.5 that knows to take care of URL appending? (taking care of putting "?" or "&" depends on the fact that the query param is the first one or not). Thanks, Shay ...

How to Index Only Pages with Certain Urls with Nutch?

Hi, I want nutch to crawl abc.com, but I want to index only car.abc.com. car.abc.com links can in any levels in abc.com. So, basically, I want nutch to keep crawl abc.com normally, but index only pages that start as car.abc.com. e.g. car.abc.com/toyota...car.abc.com/honda... I set the regex-urlfilter.txt to include only car.abc....

file_get_contents function not working

Hi All, I have some problem with file_get_contents() function, it not working properly when I tried to read URL like "http://google.com" is accessible but when I tried to access any file like "classes/connect_temp.txt" it is not accessible. Here is some code i use $file_path =realpath('./')."/classes/connect_temp.txt"; $...

How to get just last word for a variable in a PHP "$_SERVER['REQUEST_URI']" request?

I'm using WAMP and the root folder of my page is: http://localhost/projects/bp/ In a Worpress application and I want to give unique id's to the body tag of every Page. So I did the following: <?php $page = $_SERVER['REQUEST_URI']; $page = str_replace("/","",$page); $page = str_replace(".php","",$page); $page = str_repla...