htaccess question

htaccess question

Posted by: oion
Posted on: 2004-07-03 08:37:00

I'm considering using the SolidComponents PHP things included in my account, but to do so I'd need to convert all my pages - which are .shtml - to .php (for consistency, instead of just one page being .php and the rest .shtml).

That isn't a problem in itself, but because a number of other sites link to individual pages, I was wondering if it's possible to avoid sending a 404 error page for linked shtml pages by automatically sending people to the corresponding php page via htaccess. Not individual page redirects in an htaccess file, but is it possible to use a wildcard notation? Would this create too much unnecessary server overhead? Or maybe there's another way.

Otherwise I suppose I'll just let people get the error page for a while; at least that's customized to look pretty.

Thanks

Re: htaccess question

Posted by: ardco
Posted on: 2004-07-03 11:20:00

In reply to:

..., but because a number of other sites link to individual pages, I was wondering if it's possible to avoid sending a 404 error page for linked shtml pages by automatically sending people to the corresponding php page via htaccess.


Absolutely. Redirect, or probably better RedirectPermanent. Or something even better somebody else knows.

In reply to:

Not individual page redirects in an htaccess file, but is it possible to use a wildcard notation? Would this create too much unnecessary server overhead? Or maybe there's another way.


There's always another ways. :-) There's probably a good redirect available, or link the old shtml pages to the new php pages and/or try AddType to parse shtml as php.

In reply to:

Otherwise I suppose I'll just let people get the error page for a while; at least that's customized to look pretty.


Never commit such a crime against humanity!

I see the older version of a web publishing book, which said:

Final Tip

Reorganize your file system after you're listed in all the Web directories and search engines. That way users will be sure to get "404 Not Found" messages after finding your site in Yahoo or WebCrawler.

has been revised in the newer older version to be more direct:

Final Tip
It is not a great idea to reorganize your file system after you're listed in all the Web directories, after folks at other sites have linked to articles on your server, and after search engines have discovered your sites. You don't want users getting "404 Not Found" messages after finding your site in Yahoo or Google.

Cheers,

BobS

Re: htaccess question

Posted by: oion
Posted on: 2004-07-04 06:06:00

Thanks for the tip for AddType:
https://panel.dreamhost.com/kbase/index.cgi?area=745

Now I'm just curious about server overhead, but I doubt it'd be terrible.

As for the general advice not to change a site after it's been established in "the system" - that's true, but extremely unrealistic. :P The internet is always moving, and one can't expect a site to remain static for 5 years or something. Having individual redirects for specific pages is fine - I had been doing that for some already, but other people/engines need to also be proactive in maintaining their own pages when they link to other sites.

Besides, my 404/etc. is much more functional and (I hope) humorous than the usual error pages. :)

Re: htaccess question

Posted by: Atropos7
Posted on: 2004-07-04 19:31:00

Now how can you top this?

Cannot find Weapons of Mass Destruction


cool Perl / MySQL / HTML+CSS

Re: custom error pages

Posted by: oion
Posted on: 2004-07-05 08:32:00

[OT]
This has been a personal favorite for a while:
http://www.ibiblio.org/404

Tags: htaccess filephpshtml404 error pagewildcardconsistencyunnecessarysuppose