Welcome, Guest. Please login or register for free.
Did you miss your activation email?
Friday 25 July 08 07:57 BST (UK)
Welcome Home Help Shop Search Calendar Login Register
Search Images 

Online
 
  First Name(s)

Last Name

 
News: Ad: New! FULL 1841 Census: England - Isle of Man - Wales  - Channel Islands Now online. No missing counties.

+  RootsChat.Com
|-+  General
| |-+  The Common Room
| | |-+  Free RootsChat Webspace (Moderator: trystan)
| | | |-+  Apache help please
« previous next »
Pages: [1] Print
Author Topic: Apache help please  (Read 393 times)
gbaynes
RootsChat Member
***
Offline Offline

Posts: 119



WWW
Apache help please
« on: Sunday 15 October 06 11:17 BST (UK) »

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
*******
Online Online

Posts: 4976


by My Daughter. Chatting to find her Roots !


WWW
Re: Apache help please
« Reply #1 on: Sunday 15 October 06 13:25 BST (UK) »

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:
Code:
<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.   Grin Grin

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 Huh
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 Offline

Posts: 119



WWW
Re: Apache help please
« Reply #2 on: Sunday 15 October 06 21:04 BST (UK) »

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.

Lips Sealed

George Baynes
Logged
Zeb
RootsChat Senior
****
Offline Offline

Posts: 431



WWW
Re: Apache help please
« Reply #3 on: Monday 16 October 06 00:26 BST (UK) »

Seems you want to make use of the mod_rewrite function.

http://corz.org/serv/tricks/htaccess2.php

It involves making a small file called .htaccess which is just plain text, adding a few directives and uploading to your web space. Be careful though as it is possible to take an entire site offline when used incorrectly.
Logged

Derby: WOODCOCK (Donnington)
Devon: HARRIS (Plymouth)
Lancashire: DERRICK
Lincolnshire: CROPPER, WOODCOCK (Boston)
London: BARKER, DUGGIN, HARRIS, HINTON, HULBERT, WHITE
Wales: HARRIS, PRITCHARD (Pembrokeshire)
Warwickshire: DERRICK, WOODCOCK
Desperate for my Woodcocks from Birmingham!
gbaynes
RootsChat Member
***
Offline Offline

Posts: 119



WWW
Re: Apache help please
« Reply #4 on: Monday 16 October 06 20:15 BST (UK) »

Thanks Zeb

That's the one I wanted.

George Baynes
Logged
gbaynes
RootsChat Member
***
Offline Offline

Posts: 119



WWW
Re: Apache help please
« Reply #5 on: Monday 16 October 06 21:15 BST (UK) »

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
Zeb
RootsChat Senior
****
Offline Offline

Posts: 431



WWW
Re: Apache help please
« Reply #6 on: Tuesday 17 October 06 08:21 BST (UK) »

A file on Unix starting with a dot is a system file and hence hidden. Many FTP programs either show these by default or have a setting to show them. In my FTP program I need to specify "-a" as a connection flag.

Download the .htaccess file to your computer and make a copy as .htaccess.back so you can fall back to it if things go weird and you lose your site. Try editing the file, add your bits & pieces to it and upload it in text mode and try it. You will need to close the browser and re-open it again before accessing the site as the .htaccess file will need to be reloaded.

The .htaccess file is quite flexible so it shouldn't really matter where you add your RewriteEngine code. The most complex one I've written so far had about 20 lines.
Logged

Derby: WOODCOCK (Donnington)
Devon: HARRIS (Plymouth)
Lancashire: DERRICK
Lincolnshire: CROPPER, WOODCOCK (Boston)
London: BARKER, DUGGIN, HARRIS, HINTON, HULBERT, WHITE
Wales: HARRIS, PRITCHARD (Pembrokeshire)
Warwickshire: DERRICK, WOODCOCK
Desperate for my Woodcocks from Birmingham!
trystan
Moderator
RootsChat Aristocrat
*******
Offline Offline

Posts: 1777


One of the RootsChat Caretakers


WWW
Re: Apache help please
« Reply #7 on: Tuesday 17 October 06 10:37 BST (UK) »

That's correct. We add the .htaccess file automatically to all free webspace, and it cannot be modified by users.
Logged

Send RootsChat a postcard:
RootsChat.com, Europa House, Barcroft Street, Bury, Lancashire, BL9 5BT
Admin Tip: Forgotten your Username or Password and would like to reply to one of these messages?  CLICK HERE to get a reminder.
AOL Users: You may need to 'cut and paste' any links you get in emails for them to work.
Zeb
RootsChat Senior
****
Offline Offline

Posts: 431



WWW
Re: Apache help please
« Reply #8 on: Tuesday 17 October 06 12:19 BST (UK) »

Ah! Well that sorts that! Grin
Logged

Derby: WOODCOCK (Donnington)
Devon: HARRIS (Plymouth)
Lancashire: DERRICK
Lincolnshire: CROPPER, WOODCOCK (Boston)
London: BARKER, DUGGIN, HARRIS, HINTON, HULBERT, WHITE
Wales: HARRIS, PRITCHARD (Pembrokeshire)
Warwickshire: DERRICK, WOODCOCK
Desperate for my Woodcocks from Birmingham!
Pages: [1] Print 
« previous next »


[Copyright] [Free RootsChat Webspace] [Your Surname Interests] [Shrink Link] [About Us] [Terms of Use]
All Census Lookups are Crown Copyright, National Archives for academic and non-commercial research purposes only
RootsChat.com cannot be held responsible directly or indirectly for the messages or content posted by others. Inline images in messages are the copyright of the respective linked sites.
RootsChat.com, Europa House, Bury, Lancashire, BL9 5BT
0.14:21