url

Using a colon (:) in a url with ASP.NET/IIS

I'm implementing a custom controller in ASP.NET MVC and really want to be able to use a colon in the urls, so that I can identify class/column names and their values, like so: http://mysite.com/user:chaiguy ...but apparently ASP.NET or IIS doesn't allow colons in urls. I did some digging and apparently it's considered a security issue,...

Using .htaccess to redirect from one domain to another

Hi, I recently purchased a new domain for my WordPress site and I want to redirect anyone who visits using an old domain to the new one. I haven't moved servers, just added a new domain. For instance, if they went to either of these: http://www.example.net/some-article/ http://example.net/some-article/ Then I'd like them to be redir...

Manage url-writing in .htaccess or in PHP code?

I'm studying how to do url rewriting in a LAMP framework. I began my research by studying wordpress code. I looked at wordpress's .htaccess and saw this: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] </IfMod...

Get Google to Index Dynamic PHP Pages

Hi - I'm planning on having a website where the links aren't set HTML pages (ex. mypage.com/contact_me.html) but dynamic (profile.php?uid=32320&mode=2). How can I get Google to index a website like this, so that every profile (much like facebook has done) is indexed separately on google? Thanks! ...

xmlHTTPrequest won't open ("GET" , url, true); I'm miffed! PHP

I've been trying to get a url to open but I'm miffed as to why this hasn't worked. The code is listed and explained below. Any help will be deeply appreciated. The object: function getXMLHTTPRequest() { var req = false; try { /* for Firefox */ req = new XMLHttpRequest(); } catch (err) { try { /* fo...

Unable to have subURLs in Joomla

I have a domain www.mysite.com. I would like to have the following domains books.mysite.com news.mysite.com Is it possible to have the subURLs in one Joomla installation when the content in the subURLs differ? ...

best way to determine if a URL is an image in PHP

Using PHP, given a URL, how can I determine whether it is an image? There is no context for the URL - it is just in the middle of a plain text file, or maybe just a string on its own. I don't want high overhead (e.g. reading the content of the URL) as this could be called for many URLs on a page. Given this restriction, it isn't esse...

How do I make an http request using cookies on Android?

I'd like to make an http request to a remote server while properly handling cookies (eg. storing cookies sent by the server, and sending those cookies when I make subsequent requests). It'd be nice to preserve any and all cookies, but really the only one I care about is the session cookie. With java.net, it appears that the preferred w...

Changing URL schemes in wordpress without breaking old URLs

I started a blog and after a couple posts decided I didn't like the /2009/03/26/foo-bar scheme for URLs (I changed to just /foo-bar). But for the couple posts posted before I changed this, I want to add rewrite rules so the old URLs don't break. I've tried every variation of the following I could think of in the .htaccess file, to no a...

request.serverVariables() "URL" vs "Script_Name"

I am maintaining a classic asp application and while going over the code I came across two similar lines of code: request.serverVariables("URL") ''# Output: "/path/to/file.asp" request.serverVariables("SCRIPT_NAME") ''# Output: "/path/to/file.asp" I don't get it... what is the difference? both of them ignore the URL rewriting that I ...

$_GET without foo

How can I use download.php?get=file.exe with without the get variable, like download.php?=file.exe, using the $_GET in PHP? ...

REST Url Structure - Can ID of Resource go before controller?

The standard template for ASP.NET MVC (and MVC in general) seems to be {controller}/{action}/{id}, however, on a project i'm currently working on i'm not sure if that is an appropriate structure. If for example I had an application that controlled a car, to me it would make more sense to me to have the structure below: {car-rego}/{con...

Question about character of NSString invalid in URL on iPhone

Some of my http request has 'space' in URL, but it is not recognized by iPhone. I have to change 'space' to '%20' whenever there is a 'space' in the url. Now I have to send a message typed by the user to the server and it can have as many 'spaces' as the user like. It looks like I have to replace them all.(stringByReplacingOccurrencesOfS...

Using HyperLinkFields to display details

Hi, I have a web app (ASP.NET 2.0 C#)where I get data from an Oracle database into a gridview. I had asked in a previous question how I could turn that data into links that would, for example, take me to a details page. This was the answer I got: <asp:HyperLinkField DataNavigateUrlFields="ID" DataNavigateUrlFormatString="DetailPa...

Detecting a (naughty or nice) URL or link in a text string

How can I detect (with regular expressions or heuristics) a web site link in a string of text such as a comment? The purpose is to prevent spam. HTML is stripped so I need to detect invitations to copy-and-paste. It should not be economical for a spammer to post links because most users could not successfully get to the page. I would...

Google Adding Strange Directory Name To Site Links

Hi guys, I have just been asked to find out why a clients website be listed in Google in an interesting way. Some of the links have an extra directory with a (seemingly) random name. The url. http://www.servicedofficecompany.co.uk/resources/ Is listed by google as. http://www.servicedofficecompany.co.uk/(A(khbmZF83yQEkAAAAZGQ1OThh...

Create Tinyurl style hash

does anyone know of an algorithm that generates hashes that look like tinyurl hashes from a string (url) I think the requirements would be case sensitive short numbers and alphabets only anything else? ...

Ways to insert javascript into URL?

Duplicate of: What common web exploits should I know about? This is a security question. What should I look for in URL that prevents hacking? Is there a way to execute javascript by passing it inside a URL? As you can see I'm pretty new to this concept. Any good posts on this stuff? ...

Using JavaScript to change the URL used when a page is bookmarked...

JavaScript doesn't allow you to update window.location without triggering a reload. While I agree with this policy in principle (it shouldn't be possible to visit my website and have JavaScript change the location bar to read www.yourbankingsite.com,) I believe that it should be possible to change www.foo.org/index to www.foo.org/help. ...

How would you attack a domain to look for "unknown" resources?

Given a domain, is it possible for an attacker to discover one or many of the pages/resources that exist under that domain? And what could an attacker do/use to discover resources in a domain? I have never seen the issue addressed in any security material (because it's a solved problem?) so I'm interested in ideas, theories, best-guess...