How to direct bla.com/faq to bla.com/faq.htm

They have: 4 posts

Joined: Oct 2003

Hey all,

This may be the dumbest question ever, but I never learned how people direct someone who types a url into their browser like

http://www.invitationsathome.com/holiday

to go to

http://www.invitationsathome.com/holiday.htm

I am creating a print ad, and I want the URL to be as simple as possible. Any help anyone could offer would be greatly appreciated!

Thanks,
Gina

mairving's picture

They have: 2,256 posts

Joined: Feb 2001

It is always said that the dumbest question is the one not asked.

There are several ways to do it. The easiest is to create a directory called holiday inside your webroot. In that directory have a index.htm file. In that index.htm file, add this to the head section of the html:

This basically sends a redirect to redirect the page. You could also use some rewrite rules inside a .htaccess file but it would be much more difficult.

Mark Irving
I have a mind like a steel trap; it is rusty and illegal in 47 states

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

.htaccess solves this problem nicely.

RedirectPermanent /holiday <a href="http://www.invitationsathome.com/holiday.htm" class="bb-url">http://www.invitationsathome.com/holiday.htm</a>
'

If you have the directory in place, you can still use .htaccess, by putting the same information in the .htaccess file.

Of course, you could also just make an index.html file and put it in the /holiday/ folder instead of holiday.htm in the root folder, which would make sense and avoid all this mucking around.

He has: 296 posts

Joined: May 2002

If you can use PHP, PHP.net has their source available for download. It looks nice and stuff. But the .htaccess looks like your best bet.

Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.