url

serve with apache all paths under a domain through one script.

i'm hosting a website through a hosting company [1] on a linux/apache server. until now i serve the different content through one script with parameters. an example url is www.mydomain.com/pages.php?date=1-10-2008 now i want to change the scheme the url is composed of to something which looks completely like a path url. eg.: www.mydo...

URL Rewriting

i am using URL rewriting in my asp.net application using regx virtual URL is /ProductDatabaseCMS/(?<category>\w*)/Product/(?<product>\w*)\.aspx original URL is /ProductDatabaseCMS/Product.aspx?PROD_ID=${product} application path is ~/ProductDatabaseCMS my application has master page that uses style sheet and the path is ~/App_Th...

What is the best way with Apache to redirect a blank subdomain to another subdomain?

I want any request to http://example.com/* to be redirected to http://www.example.com/*. Where * is any arbitrary path. ...

How to convert an integer to the shortest url-safe string in Python?

I want the shortest possible way of representing an integer in a URL. For example, 11234 can be shortened to '2be2' using hexadecimal. Since base64 uses is a 64 character encoding, it should be possible to represent an integer in base64 using even less characters than hexadecimal. The problem is I can't figure out the cleanest way to con...

How can I stop asp.net encoding & in Get params?

I am using the following code to add a series of calls to the body parameter of a page in asp.net: uxBodyTag.Attributes["onbeforeunload"] += "ajaxRequest('UnlockQuery.ashx?QueryID=" + queryId.ToString() + "&UserID=" + Session["UserID"].ToString() + "');"; This is being rendered as: <body id="uxBodyTag" onbeforeunload= "ajax...

Mocking a URL in Java

We have a URL object in one of our Java classes that we want to mock, but it's a final class so we cannot. We do not want to go a level above, and mock the InputStream because that will still leave us with untested code (we have draconian test coverage standards). I've tried jMockIt's reflective powers but we work on Macs and there are ...

What two separator characters would work in a URL anchor?

I use anchors in my URLs, allowing people to bookmark 'active pages' in a web application. I used anchors because they fit easily within the GWT history mechanism. My existing implementation encodes navigation and data information into the anchor, separated by the '-' character. I.e. creating anchors like #location-location-key-value-k...

Is it safe to use Python UUID module generated values in URL's of a webpage?

Is it safe to use Python UUID module generated values in URL's of a webpage? Wnat to use those ID's as part of URL's. Are there any non-safe characters ever generated by Python UUID that shouldn't be in URL's? ...

Matching a web address through regex

I want to match a web address through regex which should capture http://www.google.com as well as www.google.com i.e. with and without protocol. ...

how to get domain name from URL

How can I fetch a domain name from a URL String? Examples: +----------------------+------------+ | input | output | +----------------------+------------+ | www.google.com | google | | www.mail.yahoo.com | mail.yahoo | | www.mail.yahoo.co.in | mail.yahoo | | www.abc.au.uk | abc | +-----------...

How best to validate that a URL is on the public internet?

I want to validate that a hostname/IP address is on the public internet; that is, that as far as is reasonable, I'd get the same response from it no matter where I access it from (obviously that's impossible to guarantee. ie I want to exclude localhost, 127.0.0.1, anything in the private IP ranges, and anything that has an invalid TLD. ...

Was FxCop wrong to tell me to use the .Net Uri class?

When getting a URL for something in an Amazon S3 bucket it can append a signature to the end to confirm that the user has permission to view the object and the URL looks like so: https://mybucket.amazonaws.com/mykey?AWSAccessKeyId=myaccesskey&amp; Expires=1235241261&Signature=t5vFBWXaN0DvVaWfck9n2%2fmTzOU%3d These URLs were comin...

What is the "?" symbol in URL used for in php?

Hi, I am new to PHP. In the path of learning PHP language, I notice that, some website would this kind of URL: www.website.com/profile.php?user=roa3&... My questions: What is the "?" symbol used for? If I were develop a php website, must I use it in my URL? For example, after a user(roa3) successful logged in, I will redirect to "w...

How determine redirect url

How can I know where a url gets redirected programatically? e.g. This url: http://scobleizer.com/feed/ redirects to the following url: http://feeds2.feedburner.com/fastcompany/scobleizer I am trying to read the xml document of feed. But the following lines of code: var doc = new XmlDocument(); doc.Load(url); will throw an exeptio...

URL query string convention for multiple sort

I have a RESTful web application that supports multiple sort fields on a collection of items. Is there a common convention for encoding these sort fields into the query string of a URL? I'm considering a pattern like the following: http://myapp.com/books?sort=author:asc,datepublished:desc&amp;count=12 This would sort the collection o...

Need help approving a user with encryption url.

I'm working on a piece of a web application in ASP.Net MVC where the user registers for membership using an sql membership provider. When they register they are put in the system but not approved. The code then sends an approval email to the user with the email given. BfEncrypt refid = new BfEncrypt(); refid.Encrypt(user.ReferenceID);...

Including a PHP file, treats relative URLs from that directory.

I have a PHP file at my server root.. index.php .. which include's .. DIR/main.php Now .. DIR/main.php .. include's many nearby PHP files using relative URLs using .. include("./common1.php"); Any way I can change the relative-URL base path so when including "DIR/main.php" It can relatively access its nearby PHP files like "DIR/common...

How do you see the client-side URL in ColdFusion?

Let's say, on a coldfusion site, that the user has navigated to http://www.example.com/sub1/ The server-side code typically used to tell you what URL the user is at, looks like: http://#cgi.server_name##cgi.script_name#?#cgi.query_string# however, "cgi.script_name" automatically includes the default cfm file for that folder- eg, that ...

What does the dot-slash do to PHP include calls?

A. What does this do? require ("./file.php"); B. in comparison to this? require ("file.php"); (Its not up-one-directory.. which would be) require ("../file.php"); ...

Change relative link paths for included content in PHP

I have a PHP file at my server root.. index.php .. which include's .. DIR/main.php Now .. DIR/main.php .. has relative links to many nearby files. All the relative links are broken. Any way I can change the relative-URL base path for links? ... so the included content of DIR/main.php has all its links to friend1.php changed to DI...