views:

393

answers:

3

This may be a bizarre question - and it may be a duplicate. I wasn't sure how to search for an an existing answer, so if this is a duplicate, I apologize.

We have a request from a client to have their site redirect visitors so their browser displays the default page in the url.

So instead of doing this:

http://www.domain.com/

they want it to display:

http://www.domain.com/default.aspx

Is there a setting in IIS 6 that can be applied that would allow this to happen?

This question http://stackoverflow.com/questions/1010727/hiding-default-aspx-from-the-url is asking the opposite... how to remove the default.aspx. The answer there was to add a 301 redirect in the default.aspx code. Would that be the best answer here as well?

If so, that would fix the /default.aspx issue. However, I think the client may ask us to do this for all subfolders as well. Will we just need to add 301 redirects in the code wherever this is needed?

Or maybe we need to look into using a tool like this - http://www.helicontech.com/ where we can just use .htaccess files to do whatever 301 redirects we need.

Thanks for any input!

-- edit --

Just to be clear, I do know HOW to search for an existing question, I just wasn't sure what to search for in this case.

+1  A: 

This answer is based off the IIS5.1 approach but open up Internet Information Services, right-click on your website, choose properties go to Documents and click Enable default document and add "default.aspx" first onto the list.

Not sure if thats what you were looking for, but good luck.

Anthony Forloney
The default.aspx document is already set to be the default document - so if you visit www.domain.com you are visiting the default.aspx page, but the client wants default.aspx to show up in the browser's url area.
meh
try inside of the Home Directory select 'Redirect to a url' and type in the URL there, I am not sure if default.aspx will be visible or not, but check it out.
Anthony Forloney
A: 

There is another question I missed.

http://stackoverflow.com/questions/686681/url-rewrite-from-default-aspx-to

Looks like everyone is is removing the default.aspx instead of the other way around, but the process should be the same. In the two questions I've found, people are using 301 redirects - either in the code or by using rewriting tools.

meh
A: 

This is a bit of an odd request. You could always set the default document to redirect.aspx, and in the load event of that page do a redirect to default.aspx

Not sure how this would affect search engines.

ScottE