|
Home > Archive > Apache Server configuration support > January 2007 > Leaving out the file extension
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Leaving out the file extension
|
|
| Mike Azzopardi 2007-01-10, 1:19 pm |
| Hi
I'm hoping someone will help me with a problem please.
On a webserver I was using (apache), I noticed that you could leave the
..htm off the end of files and the webpage would still display correctly
(not an index.htm file but any htm file)
e.g.
www.server.com/file1.htm would display correctly if I typed the URL
www.server.com/file1 without the file extension.
But I have moved hosting companies (I believe they are using a windows
2003 server) and it doesn't let me leave out the .htm.
If anyone could shed any light it would be most appriciated.
best regards
mike
| |
| Mike Azzopardi 2007-01-10, 1:19 pm |
| thank you for the replies.
I will check with the person that was hosting the old server if he had
any rewrite rules. I have just found out that the hosting company I
have moved to also has unix web servers (although this is a hosting
company rather than someone who was hosting the site for me before from
his home). So I'm guessing I might be able to use the old rewrite rules
on the new server? is this something hosting companies will let me do
maybe?
The reason I did this in the first place was because the site is full
of independant bands and they can get to their page easily by doing
www.site.com/band1 like with myspace, and it brings up their webpage
band1.htm. I was guessing that this is how other sites do this, but it
appears I am mistaken.
best regards
mike
Erwin Moller wrote:
> Mike Azzopardi wrote:
>
>
> Hi Mike,
>
> I expect your former server had some rewriterules (mod_rewrite) in the
> configfile, probably adding .htm if no extension was given.
> I do not know of such a engine under IIS.
>
> My advise would be to fix the file extension.
> Why did you leave them out in the first place?
>
> Regards,
> Erwin Moller
| |
| Erwin Moller 2007-01-10, 1:19 pm |
| Mike Azzopardi wrote:
> thank you for the replies.
>
> I will check with the person that was hosting the old server if he had
> any rewrite rules. I have just found out that the hosting company I
> have moved to also has unix web servers (although this is a hosting
> company rather than someone who was hosting the site for me before from
> his home). So I'm guessing I might be able to use the old rewrite rules
> on the new server? is this something hosting companies will let me do
> maybe?
Ok Mike,
Probably yes.
Be sure to check Davide's answer too about multiviews (also in config).
[vbcol=seagreen]
>
> The reason I did this in the first place was because the site is full
> of independant bands and they can get to their page easily by doing
> www.site.com/band1 like with myspace, and it brings up their webpage
> band1.htm. I was guessing that this is how other sites do this, but it
> appears I am mistaken.
>
> best regards
> mike
>
> Erwin Moller wrote:
| |
| Mike Azzopardi 2007-01-10, 1:19 pm |
| Hi Davide
Is multiview on by default? If not where do we turn it on? I chatted to
my friend who was hosting the apache server, and he said he didn't do
anything in particular to make the .htm not be required and doesn't
know how. So it just works on his server and not on the other. Could
anyone be so kind as to tell me what to look for on the apache server
with regards to multiview and the other config files so as we may have
a clue to what needs to be copied across to get this to work please?
best regards
mike
Davide Bianchi wrote:
> On 2007-01-10, Mike Azzopardi <mikeazzo22@hotmail.com> wrote:
>
> That's a standard feature of the multiviews: it will try to pick the
> file that more 'matches' the one you're asking for in a range of
> possible extensions. As long as you don't have a directory with the same
> name of the file.
>
> Davide
>
> --
> Q: What's another name for the "Intel Inside" sticker they put on Pentiums?
> A: Warning label.
| |
| Davide Bianchi 2007-01-10, 1:19 pm |
| On 2007-01-10, Mike Azzopardi <mikeazzo22@hotmail.com> wrote:
> Is multiview on by default?
I think so, but it depends on the kind of Apache distributions that was
used.
> If not where do we turn it on?
By changing the Options of the directory (Root Directory or the dir
where you want the option on), if it allow you to overwrite such config
using .htaccess try using Options +Multiviews in there.
> anyone be so kind as to tell me what to look for on the apache server
> with regards to multiview and the other config files so as we may have
> a clue to what needs to be copied across to get this to work please?
Why don't you just skim a little the Apache documentation? Multiviews is
clearly explained in there.
And, please, do not top-post.
Davide
--
If I held you any closer I'd be on the other side of you.
-- Julius Henry "Groucho" Marx (http://en.wikiquote.org/wiki/Groucho_Marx)
| |
| Evan Platt 2007-01-10, 7:31 pm |
| On 10 Jan 2007 07:17:19 -0800, "Mike Azzopardi"
<mikeazzo22@hotmail.com> wrote:
>The reason I did this in the first place was because the site is full
>of independant bands and they can get to their page easily by doing
>www.site.com/band1 like with myspace, and it brings up their webpage
>band1.htm. I was guessing that this is how other sites do this, but it
>appears I am mistaken.
A simpler solution is to have the main file be index.html in
/docroot/band1, ie /wwwroot/band1/index.html , so when you go to
www.site.com/band1 , assuming you have index.html as a default, you'll
get the index file?
| |
| Mike Azzopardi 2007-01-11, 7:38 am |
|
Evan Platt wrote:
> On 10 Jan 2007 07:17:19 -0800, "Mike Azzopardi"
> <mikeazzo22@hotmail.com> wrote:
>
>
> A simpler solution is to have the main file be index.html in
> /docroot/band1, ie /wwwroot/band1/index.html , so when you go to
> www.site.com/band1 , assuming you have index.html as a default, you'll
> get the index file?
Thank you. This sounds great.
|
|
|
|
|