Wild card symbol in name?

J

John

Problem:

I'm looking after a web site (myjourney.ca) which WAS hosted on site, using a
program (Article Manager) where all pages had the "shtml" extension.
Many of these pages are still indexed in various search engines.
So far, during February I have had well over a 1000 hits in almost 400 sessions
to these now "non-existing" pages, resulting in potential browsers getting a
"Not Found" message (The requested URL /mainpage.shtml was not found on this
server.).

We changed to a different system, (the domain name remains the same) and all
pages now have the "html" extension.

Question: Is there a way whereby I can create a page with an "shtml" extension,
using a wild card character such as * (*.shtml" for example) , and install it
on the current site so that those who follow any outdated link with an "shtml"
extension would go to that page?

Thanks for any help and suggestions!
John <><
 
D

David Dorward

John said:
Question: Is there a way whereby I can create a page with an "shtml"
extension, using a wild card character such as * (*.shtml" for
example) , and install it on the current site so that those who follow any
outdated link with an "shtml" extension would go to that page?

If you have Apache you could do something like:

RedirectMatch permanent ^(.*)shtml http://www.example.com/$1.html

(Note that that is untested, from memory, and I haven't used RedirectMatch
very much, so you might have to resort to the manual).
 
J

Jim Higson

John said:
Problem:

I'm looking after a web site (myjourney.ca) which WAS hosted on site,
using a program (Article Manager) where all pages had the "shtml"
extension. Many of these pages are still indexed in various search
engines. So far, during February I have had well over a 1000 hits in
almost 400 sessions to these now "non-existing" pages, resulting in
potential browsers getting a "Not Found" message (The requested URL
/mainpage.shtml was not found on this server.).

We changed to a different system, (the domain name remains the same) and
all pages now have the "html" extension.

Seems like, you're just getting into the same problem in future. What about
when you switch to .php or whatever and have to rename all your URLs again?

The URL doesn't have to be the literal name of the file. Why would the user
care if you store static html files or use shtml? They don't, and shouldn't
be exposed to this. Instead of http://example.com/example.html just use
http://example.com/example as the address - that way you can change how the
site is hosted any number of times and the URL stays the same.

Tim Berners-Lee has written on this subject. See:
http://www.w3.org/Provider/Style/URI
 
A

Alan Cole

John said:
Problem:

I'm looking after a web site (myjourney.ca) which WAS hosted on site, using a
program (Article Manager) where all pages had the "shtml" extension.
Many of these pages are still indexed in various search engines.
So far, during February I have had well over a 1000 hits in almost 400
sessions
to these now "non-existing" pages, resulting in potential browsers getting a
"Not Found" message (The requested URL /mainpage.shtml was not found on this
server.).

We changed to a different system, (the domain name remains the same) and all
pages now have the "html" extension.

Question: Is there a way whereby I can create a page with an "shtml"
extension,
using a wild card character such as * (*.shtml" for example) , and install
it
on the current site so that those who follow any outdated link with an
"shtml"
extension would go to that page?

Thanks for any help and suggestions!
John <><

If your site is hosted on an Apache server you could just use the
mod_rewrite rule within your htaccess file to rewrite the URL.

In its simplest form:

RewriteEngine on
RewriteRule ^(.*)\.shtml$ $1.html

in your htaccess file should do the trick. (assuming that the filenames
have remained the same and it is just the extensions that have changed.

Al.
 
A

Alan J. Flavell

The URL doesn't have to be the literal name of the file. Why would
the user care if you store static html files or use shtml? They
don't, and shouldn't be exposed to this.

Correct and agreed.

If you're setting up a new site, then this is certainly an option.
If you're working on existing URLs, then it may be better not to
change them.
- that way you can change how the site is hosted any number of times
and the URL stays the same.

Several of my existing *.html files are now SSI or occasionally even
CGI calls (in fact, most of my personal *.html files are now set by
"XBitHack full", to minimise the cacheability penalty for an SSI call,
but that's a local detail).
Tim Berners-Lee has written on this subject. See:
http://www.w3.org/Provider/Style/URI

Indeed, "cool URLs don't change". So keep your existing URLs, as
far as possible, by *reconfiguring the server* - to treat them as
SSI, PHP, or whatever you want to introduce, without losing the
existing .html extension. There's nothing sacrosanct about a
particular filename extension.

But whenever introducing server-side processing techniques, *do* give
a thought to cacheability. More and more web sites seem to be getting
intolerably slow to respond, *even for revisiting a page that I was
looking at only moments ago*, and when I look more closely, they
almost always wrecked their cacheability by clumsy use of server-side
processing.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,579
Members
45,053
Latest member
BrodieSola

Latest Threads

Top