[Pro] .htaccess

Hi,

It’s not directly related to Freeway (other than the site is built in Freeway) but, does anyone know what I need to put in my .htaccess file to make it so that if someone types in:

www.mywebsite.com/casestudy1

they will be taken to

www.mywebsite.com/casestudy1.php

(Basically it puts a .php on the end).

I’m sure it’s possible but I can’t find a jargon free answer on the net.

Thanks,

Sly.


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

The Apache feature you want to enable is known as MultiViews.
Basically, it takes any request, first tries it as written to see if
it matches (might be a folder), then tries adding suffixes to it and
sees if that matches. This adds a little time to the request (while
Apache plays 20 Questions with the filesystem) but the result is that
you can have very flexible URLs like this.

Doing this in a rewrite will be pretty tricky, because it could put a
missing request (404) into an infinite loop, tacking .php on the end
of it until you run out of patience and restart the server.

Walter

On Aug 5, 2011, at 11:35 AM, Sly wrote:

Hi,

It’s not directly related to Freeway (other than the site is built
in Freeway) but, does anyone know what I need to put in my .htaccess
file to make it so that if someone types in:

mywebsite.com is available for purchase - Sedo.com

they will be taken to

mywebsite.com is available for purchase - Sedo.com

(Basically it puts a .php on the end).

I’m sure it’s possible but I can’t find a jargon free answer on the
net.

Thanks,

Sly.


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


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

Thanks Walter,

So you are suggesting enabling MultiViews rather than using ReWrite?

If so how would this be done?

Thanks,

Sly.


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

Yes. EIther look for this feature in your Apache settings on your
server’s control panel, or ask your hosting provider to enable it for
you. It’s usually one click, and a restart, and away you go.

You may even be able to enable this using your htaccess file (put this
fairly high up, before any rewrites):

Options +MultiViews

As long as that doesn’t result in an immediate 500-series error on
your next try of the site, you should be good. If you do get a 500
error, that means that your host has disabled your ability to change
this setting through htaccess – not necessarily that it cannot be
done at all through some other means.

Walter

On Aug 5, 2011, at 12:29 PM, Sly wrote:

So you are suggesting enabling MultiViews rather than using ReWrite?


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