Developer forum

Forum » Development » Dont allow domain/defaultaspx to be requestet

Dont allow domain/defaultaspx to be requestet

Jacob Jensen
Reply
Hi.

Is there any way to ensure that request to domain/default.aspx is redirected to domain/

I know there isent any point in doing this, but out customers SEO "expert" says it creates dublicate content in google, in which i dont fully agree, but our customer needs it sortet out.

Iam new in dynamic.web, but using the api is no problem, my only problem is to detect if the url is domain/default.aspx without any querystrings, if so, redirect to domain/

Iwe already looked at Base.GetHttpXXX(), but all of these return default.aspx on the frontpage.

Best regards
Jacob

Replies

 
Nicolai Høeg Pedersen
Reply
Oh... Very sensitive question!

But I totally agree with you - of course this does not mean DC - Google can conquer the world, but they can't handle this?

Problem is, that IIS does not tell weather you have Default.aspx or not in the browsers URL. Because the Default Document feature in IIS tells us that Default.aspx is the file in both scenarioes (www.domain.com/Default.aspx and www.domain.com).

I've investigated this before and have not found a solution...

If anyone have some possible solution for this, please give us your knowledge!

BR Nicolai

 
Jacob Jensen
Reply
Yeah, my conclusion to. I know its possible with clientscript to read the “address bar” url, but the serverside url must have a document. Without any document specified the server takes IIS default document.

Thx for ur time.
/Jacob

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
If anyone have some possible solution for this, please give us your knowledge!

Some time ago I sent you a sample solution involving an HTTP Handler. Would that do the trick?

Imar
 

 
Jacob Jensen
Reply
How would you accomplish this job, with an httphandler ?

The problem, is that serverscript always will return default.aspx with or without default.aspx after domain.xx/

Thx
Jacob

 
Morten Bengtson
Reply
Scott Guthrie mentions the problem and a solution here: http://weblogs.asp.net/scottgu/archive/2010/04/20/tip-trick-fix-common-seo-problems-using-the-url-rewrite-extension.aspx
I'm not sure if that is what you need.

/Morten

 
Jacob Jensen
Reply
The solution should work, i just cant find any documentation on what urlrewriting system dynamic.web is using, so I don’t know what happens when i put the rule in web.config, further our dynamic.web solution are hosted at hostnordic, I only have an FTP account to the /Files/ directory, so I cant modify web.config, and I don’t know if they have IIS url rewriting enabled, or worse, isn’t running IIS 7.X.

@Nicolai >> Does you have any insider knowledge? :)

Thx
Jacob

 
Nicolai Høeg Pedersen
Reply
Some servers are IIS 7, older ones still IIS 6.

If you convert your solution to a custom solution, you can access the web.config as well.

Dynamicweb uses it's own URL rewriting engine, but the two should be able to coexist if configured correctly.

@Imar - the ihttpmodule will maybe do the trick, but only on IIS 7 running integrated pipeline. To include something with Dynamicweb, i would prefer a solution that works without server setup. Most of Dynamicweb installations do not run in integrated mode.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply
Attached you find a proof of concept that can detect Default.aspx or /  As Nicolai points out, it only works when running in integrated pipeline mode on IIS 7. But if that's what you happen to be running, this might do the trick. No warranties whatsoever.... ;-)

Imar

 

You must be logged in to post in the forum