[Pro] url and extension question

Hi. Does anyone know how to make sure that all the urls for the home page all redirect to one address? For example, if I were to type in after http:// the following different urls, www.anysite.com, anysite.com, www.anysite.com/index.html, www.anysite.com/default.html, I would want them to all redirect (meaning in the url in the browser they would change) to www.anysite.com. This is important for SEO reasons. Otherwise, all those urls get indexed.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

What sort of server are you hosting on? If it’s Apache, then there are tons of tricks you can do to make this happen using the mod_rewrite extension.

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Yes. It’s an Apache server.


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Make sure mod_rewrite is on for your server. Next, check to see if you already have an .htaccess file in your Web root. You’ll need to use an application like Transmit or Fetch, and you’ll need to enable either application’s “Show hidden files” option – files that begin with a dot are hidden by Unix. If you do, open that file for editing (Transmit has a built-in editor that will do perfectly for this). If you don’t, then put the following in a plain text file and upload it to your server into the root folder of your site (next to index.html). Once it’s there, rename it to .htaccess. (You won’t be able to save a file on your Mac that begins with a dot – the Finder won’t let you.)

http://pastie.org/426257

The filename part is a little trickier – I think you need to pick one filename (not the lack thereof) and use that as your single entry point. When you let Apache do the magic no-page URL, it’s actually doing a redirect, and not serving the URL you’re really requesting. As long as you choose one and stick to it, you’ll have the result you want, SEO-wise. In my example I have the redirect to index.html

Walter


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options

Thank you, Walter. I will try that out :slight_smile:


freewaytalk mailing list
email@hidden
Update your subscriptions at:
http://freewaytalk.net/person/options