- Easter bunny has been kind to me, I got TWO, yes TWO eggs – I can’t wait for all that yummy chocolate to enter my tum – what did you get? #
Powered by Twitter Tools.
Security and tech news with Xploiter.com
Be Safe, Be Secure
Powered by Twitter Tools.
Powered by Twitter Tools.
Delving into the deep dark idiosyncrasies of CSS and XHTML on my latest project
Buckarookered after spending the day demolishing wardrobes and fitting new ones, now back to web site designs yey!
Updating blog.xploiter.com and working on new site design for simonantony.co.uk – need some creative input, mine is drying up this weekend!
Firefox 3.0 is officially the most popular web browser in Europe, according to StatCounter’s latest statistics.
Although Mozilla’s browser lags behind Microsoft’s Internet Explorer if you add all of the latter’s different versions together, FireFox has finally pipped IE7 as the most used individual browser version – with 35.05 per cent of the market, according to the data.
Firefox, benefiting from the fact that it doesn’t have the same problem with ‘legacy’ users who stay on older versions of the browser and the arrival of IE8 which is prising people away from IE7.
Not much in it
The gap is currently just over half of a percentage point, and StatCounter CEO Aodhen Cullen believes that it will overtake IE’s complete range shortly.
“The move is partly explained by a small switch from IE 7.0 usage to IE 8.0 but also by growing market share overall by Firefox 3.0,” said Cullen.
“The data shows that Firefox is closing the gap and is now just 10% behind all IE versions in Europe.”
Apparently StatCounter analyse four billion pageloads per month, but it should be pointed out that other major website traffic monitoring companies come up with different figures.
By Patrick Goss
via Firefox 3.0 is Europe’s most popular browser | News | TechRadar UK.
URL Rewriting in asp.net (c#). (Download Example Project for URL Rewriting in asp.net at the end of this article)
One way to get yourselves rated better in the search engines is to get rid of the basic aspx page and replace it with something much more descriptive i.e.:
If I were selling Nokia phones, I may have a page called http://www.mydomain.com/nokia.aspx – not much good if I am trying to target a specific phone though is it? What about this then?
http://www.mydomain.com/Nokia-E71-Mobile-Phone-With-Email-And-Internet-Browser
Much more descriptive and much more likely to get the search engines juices flowing more and hence get you rated higher in the listings.
After searching around for a few solutions, I found this article by Scott GU (Microsoft Guru Extraordinaire) http://weblogs.asp.net/scottgu/archive/2007/02/26/tip-trick-url-rewriting-with-asp-net.aspx which got me excited.
He mentions a few methods, one of which I use on http://www.simonantony.co.uk which is running IIS7 by using the Rewrite module built into IIS – works a treat and has allowed me to convert a static html site into a more dynamic and search engine friendly version.
The other is to use a library from http://urlrewriter.net/ which is the other route I have taken. I’ve successfully implemented this on a project I am currently working upon and thought it would be nice of me to post some fully working example code that you can actually understand – the examples on the urlrewriter website/demos are very poor and not clear at all – no wonder so many people struggle to get it working.
Some blurb from the URLRewriting website will explain it more:
UrlRewriter.NET is an open-source, light-weight, highly configurable URL rewriting component for ASP.NET 1.1 and 2.0. UrlRewriter.NET provides similar IIS Rewrite capabilities that the Apache web server provides with mod_rewrite and .htaccess. You don’t need to install an ISAPI Rewrite filter to use the component. Best of all, UrlRewriter.NET is free and licensed with a very permissive MIT-style licence.
UrlRewriter.NET is a great Search Engine Optimization (SEO) tool. Using UrlRewriter.NET, you can create URL’s containing your target keywords, boosting your rankings.
With UrlRewriter.NET, you can:
* Rewrite URL’s from “user and Search Engine” friendly urls to the actual .aspx pages (also known as URL Masking, IIS Rewrite or ASP Rewrite)
* Redirect from old URL patterns to the new ones, ensuring the Search Engine spiders continue to follow your links (also known as URL Replace)
* Block certain visitors based on the User-Agent – very helpful for blocking crawlers that don’t obey the robots.txt protocol
* Ban users based on IP range (provides the capabilities of mod_rewrite on IIS)
* And much more…UrlRewriter.NET is a pure .NET component written in C#, and does not require any ISAPI rewrite dll’s to be installed in IIS. You configure rules in a very readable XML format, either in your web.config file or an external rewriter configuration file.
UrlRewriter.NET is in use in many websites large and small such as DotNetKicks, and is embedded in several open source packages, such as the fantastic Yet Another Forum.NET.
Anyway here is how the project is constructed and how to get it working.
<?xml version=”1.0″?>
<configuration>
<configSections>
<section name=”urlrewritingnet” requirePermission=”false” type=”UrlRewritingNet.Configuration.UrlRewriteSection, UrlRewritingNet.UrlRewriter” />
</configSections><urlrewritingnet
rewriteOnlyVirtualUrls=”true”
contextItemsPrefix=”QueryString”
defaultPage=”default.aspx”
defaultProvider=”RegEx”
xmlns=”http://www.urlrewriting.net/schemas/config/2006/07″ >
<rewrites>
<add name=”this-is-a-long-page-name” virtualUrl=”^~/this-is-a-long-page-name”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”~/longpage.aspx”
ignoreCase=”true” /><add name=”Product-Search-uk” virtualUrl=”^~/Product-Search-uk”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”~/search.aspx”
ignoreCase=”true” /><add name=”submit-your-company” virtualUrl=”^~/submit-your-company”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”~/submit_company.aspx”
ignoreCase=”true” /><add name=”this-is-my-site-blog” virtualUrl=”^~/this-is-my-site-blog”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”~/blog.aspx”
ignoreCase=”true” /><add name=”contact-my-company” virtualUrl=”^~/contact-my-company”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”~/contact.aspx”
ignoreCase=”true” /><add name=”Product-Search-uk-partnumber” virtualUrl=”^~/product(.*).aspx”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”~/search.aspx?id=$1″
ignoreCase=”true” /><!–<add name=”Rewrite” virtualUrl=”^~/(.*)/Detail(.*).aspx”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”~/Default.aspx?language=$1&id=$2″
ignoreCase=”true” /><add name=”RedirectInApplication” virtualUrl=”^~/(.*)/Default.aspx”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”~/$1/Detail_Redirected.aspx”
redirect=”Application”
redirectMode=”Permanent”
ignoreCase=”true” /><add name=”KickBrowserToDomain” virtualUrl=”^http://(.*)/SampleWeb/kickto/(.*).aspx”
rewriteUrlParameter=”ExcludeFromClientQueryString”
destinationUrl=”http://$2?source=$1″
redirect=”Domain”
redirectMode=”Permanent”
ignoreCase=”true” />–>
</rewrites>
</urlrewritingnet><appSettings/>
<system.web>
<customErrors mode=”Off”>
</customErrors>
<httpModules>
<add name=”UrlRewriteModule” type=”UrlRewritingNet.Web.UrlRewriteModule, UrlRewritingNet.UrlRewriter” />
</httpModules>
<compilation debug=”true” />
</system.web>
</configuration>
<div id=”nav”>
<div id=”navcontainer”>
<ul id=”navlist”>
<li><a href=”default.aspx”>Home</a></li>
<li><a href=”this-is-a-long-page-name”>this-is-a-long-page-name</a></li>
<li><a href=”Product-Search-uk”>Product Search</a></li>
<li><a href=”submit-your-company”>Submit your company</a></li>
<li><a href=”this-is-my-site-blog”>Blog</a></li>
<li><a href=”contact-my-company”>Contact</a></li>
<li><a href=”product123.aspx”>Note that this aspx page does not actually exist – click it and see what happens</a></li></ul>
</div>
</div>You will notice that the href links are defined in the web.config file.
<div>
This is the region page – if you click on <a href=”product12345.aspx”>product12345.aspx</a>, you will be redirected here but the code will show the arguments of the page i.e. 12345 – confused? You will be!
</div>
if(Request.QueryString[“id”] != null)
Response.Write(“querystring passed in: ” + Request.QueryString[“id”]);
else
Response.Write(“No query string passed in”);
Anyway I hope this has helped you understand how to get a basic implementation of URL Rewriting in your site – i’d love to hear of any more examples you have used, if you want to post them here let me know.
Si