Click to See Complete Forum and Search --> : Help with 301 redirects - please!


SimonRoskrow
11-18-2009, 11:06 AM
I'm a rather new website builder/administrator, and have a slightly tricky (for me) problem that I'd like a little help with.

One page of my website is:

http://www.trainingreality.co.uk/blog.php

I've created a 301 redirect to send people from ../blog.html to ../blog.php in case they type that instead (and because the page used to be a html page). This is working fine.

However, I've noticed that if some people type in:

http://www.trainingreality.co.uk/blog

they actually get

http://www.trainingreality.co.uk/blog/

which leads to an error (I've set up "branded" error pages). I'd like this one (as it's a common error) to go to the .php blog page, but I can't get 301 redirects to work. The reason is there are lots of sub-pages to the blog folder, and if I do the following redirect:

Redirect 301 /blog/ http://www.trainingreality.co.uk/blog.php

it works fine for the specific instance, but causes problems for all the individual blog pages i.e. what should be

http://www.trainingreality.co.uk/blog/Silence-is-golden.php

comes out as

http://www.trainingreality.co.uk/blog.phpSilence-is-golden.php

Anyone got any ideas - that they can explain to a simple soul like me?

Thanks, Simon.

Fang
11-21-2009, 05:03 AM
Try this<FilesMatch .*>
Options +MultiViews
</FilesMatch>
It doesn't matter to the server if the file extension is given or not.
It can give problems (http://www.gerd-riesselmann.net/archives/2005/04/beware-of-apaches-multiviews) if there are files and directories with the same name.