Forum Moderators: phranque

Message Too Old, No Replies

Go to page without typing "htm" or "html"

need to bring up a page in browser without using htm ext.

         

casey133

11:38 pm on Nov 13, 2004 (gmt 0)

10+ Year Member


Hi all, my first post here... i have been reading for a long time but i need some help how. ok here is the deal

i have one directory with the website in it (all html files, flash files, etc...)

ok lets say the addy is www.website.com ... the guy wants people to type in www.website.com/ca and bring up the other pages that i am working on, now when i upload the "ca.html" file to the ftp server and try to goto:

www.website.com/ca it says page cannot be displayed, but when i type in
www.website.com/ca.html it works great

it does the same thing with an htm ext by the way... i want people to be able to just type in www.website.com/ca and the page comes up, i dont want them to have to type in htm or html... any help on this topic?

Thanks in advance!

freeflight2

11:58 pm on Nov 13, 2004 (gmt 0)

10+ Year Member



mod_rewrite is your friend:
RewriteRule ^/ca$ /ca.html [L]

encyclo

12:00 am on Nov 14, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Welcome to WebmasterWorld [webmasterworld.com], casey133.

mod_rewrite is probably a bit overkill for this. The best way of doing this is to simply create a directory called "ca" and place an index.html within it. That would mean that example.com/ca would map to example.com/ca/ - and you could then have further files in there, such as example.com/ca/file.html.

The important thing to look out for is making sure the path to your images and other files is correct, as those won't be in the same directory any more.

casey133

12:03 am on Nov 14, 2004 (gmt 0)

10+ Year Member


of course! just like your browser looks for the index on a ftp server, it will look for the index no matter what directory you type in... so www.blabla.com/ca ... ca being the directory and the browser will do the rest...

OF COURSE! i feel about stupid now, i should have known this... thanks guys!

ControlEngineer

12:05 am on Nov 14, 2004 (gmt 0)

10+ Year Member



[quote]i want people to be able to just type in www.website.com/ca and the page comes up, i dont want them to have to type in htm or html... (/quote]

Create a subdirectory named "ca" and then name the file "index.html" and place in the directory. That is often done when someone wants people to access a particular page (perhaps from a print ad).