|
Pages: [1]
|
 |
|
Author
|
Topic: Apache help please (Read 433 times)
|
gbaynes
RootsChat Member
  
Offline
Posts: 123
|
Hi all
I remember seeing a comment from somebody about redirecting requests for webpages to a file with a different name.
ie it is possible to send out a different file to the one which was requested.
I know about the redirect in a webpage using a META tag. That is really only a temporary solution.
With the preferred method it is possible to redirect page requests from .htm and .html to .php, which is what I want to do.
Any ideas ?
George Baynes
|
|
|
|
|
Logged
|
|
|
|
Berlin-Bob
Global Moderator
RootsChat Marquessate
      
Offline
Posts: 5065

by My Daughter. Chatting to find her Roots !
|
Hi George,
Is this the comment about meta-tags you mean ??
There are a series of pages that browsers look for as default pages. If you make a file and call it "index.html" and use the following for it: <html> <head> <meta http-equiv="refresh" content="0;url=home.html"> </head> <body> Redirecting... </body> </html> Upload that into the root folder (main) of your web space and that will take care of everything for you. As it stands, if you omit the "home.html" from the end of your link we get a 404 which is the browser's way of saying "I can't find the file" This small index file will automatically redirect for you so if GEDmill keeps making your site and insists on using home.html instead of index.html then you've nothing to worry about. I'm currently converting my whole site from HTML to PHP so I will be needing this for all the old links in search engines.
For instance, the page legends.htm is now called i-legends.php and I have used Zeb's code for a "new" legends.htm with this meta-tag: <meta http-equiv="refresh" content="0;url=./i-legends.php">
I've just tried it out on my site and it works fine. 
However, you say this is only a temporary solution. Do you mean that you are looking for an "automatic" re-direct from xyz.htm to xyz.php  If anyone has a solution for this I would be interested, too (I have over 100 files which would otherwise each need a re-direct file)
Bob
|
|
|
|
« Last Edit: Monday 30 October 06 06:59 GMT (UK) by Berlin-Bob »
|
Logged
|
Searching for Coleman, Moore, Kallnung in London; Margulies, Remenyi in E. Europe; Ancestors of Hessie Stevenson-Coleman-Baxter (Ireland, 1861) and, of course, any other ancestors for my web-site http://boco.rootschat.net All Census Data included in this post is Crown Copyright (see: www.nationalarchives.gov.uk)
|
|
|
gbaynes
RootsChat Member
  
Offline
Posts: 123
|
Hi Bob
I am interested in the Server Operating System (Apache) doing the work for me.
I do not want to create a file for every instance when a couple of lines in a text file will do.
I have links on Google which are unobtainable because Google has them as .htm and they are in fact .php.

George Baynes
|
|
|
|
|
Logged
|
|
|
|
|
|
gbaynes
RootsChat Member
  
Offline
Posts: 123
|
Thanks Zeb
That's the one I wanted.
George Baynes
|
|
|
|
|
Logged
|
|
|
|
gbaynes
RootsChat Member
  
Offline
Posts: 123
|
Aaahh
The mystery deepens.
There is already a .htaccess file in my base directory, but put there by rootschat. It looks to prevent picture files being warehoused on the rootschat server. (a condition of use)
a period of horizontal thinking is required. (or is that sideways logic.?)
I can only see the .htaccess file by using an ftp program.
George Baynes
|
|
|
|
|
Logged
|
|
|
|
|
|
|
|
|
|
|
Pages: [1]
|
|
|
|
|