Forum Moderators: coopster

Message Too Old, No Replies

Understanding from where and

where to

         

maxpiter

2:13 pm on Jan 24, 2008 (gmt 0)

10+ Year Member



I need to write a script that will do the following:
Lets say I have www.site.com/index.php
If a user or a webclawler access site.com/1.html instead of being given an 404 will triger an interaction with the script(index.php) which will:
have the page the user was looking for (1.html)and will be given a page stating "you have came to 1.html"... also I need that the clawlers will consider the page existent and not a redirect.
Any help is welcome :)

gsbatch

8:46 pm on Jan 24, 2008 (gmt 0)

10+ Year Member



In .htaccess file:

Options +FollowSymLinks
RewriteEngine on
RewriteRule (.*)\.html$ index.php?refpage=$1
RewriteRule (.*)\.htm$ index.php?refpage=$1

In the index.php file add:

$refpage = $_GET['refpage'];

Now you can use $refpage to form your welcome statement.

Example:

echo "You have come to ".$refpage.".html";

maxpiter

3:54 pm on Jan 25, 2008 (gmt 0)

10+ Year Member



10x :)
I used the server variable instead (after reading some tutorial)