Notice: Undefined index: page in /var/www/nedmartin/public/test/index.php on line 9

Some test links: hrmm blah 1 2 3 this/that/other ho/ho/ho 1/2/3
super-link etc

Result:


Notice: Undefined index: page in /var/www/nedmartin/public/test/index.php on line 20

.htaccess used:

RewriteEngine on
Options +FollowSymlinks
RewriteBase /

# Allow specific filetypes
RewriteRule \.(htm|shtml|jpg|png|gif|swf|css|js)$ - [L]

# Allow plain index.php?blah addresses
RewriteRule ^(index.php.*) - [L]

# Replace blah with index.php?page=blah
RewriteRule ^(.+)$ index.php?page=$1

Page Code


<?php echo "<?xml version=\"1.0\" encoding=\"iso-8859-1\"?".">"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
    "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Test RewriteRule Page</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<?php
    $URL 
explode('/',$_GET['page']);
?>
</head>
<body>
<p>Some test links: <a href="hrmm">hrmm</a> <a href="blah">blah</a> <a href="1">1</a> 
    <a href="2">2</a> <a href="3">3</a> <a href="this/that/other">this/that/other</a> 
    <a href="ho/ho/ho">ho/ho/ho</a> <a href="1/2/3">1/2/3</a> <br />
    <a href="http://public.the-i.org/test/in/Mexican/cookery/a/thin/round/cake/made/with/either/cornmeal/or/wheat/flour/and/freq/filled/with/meat/cheese/beans/etc/Also/in/Spanish/cookery/a/thick/flat/omelette/freq/eaten/cold/in/wedges">super-link</a> 
    etc</p>
<h1>Result:</h1>
<?php
    
echo '<p>'.$_GET['page'].'</p>';
    foreach(
$URL as $link)
    {
        echo 
"<p>$link</p>\n";
    }
?>
<h1>.htaccess used:</h1>
<p>RewriteEngine on<br />
    Options +FollowSymlinks<br />
    RewriteBase /</p>
<p># Allow specific filetypes<br />
    RewriteRule \.(htm|shtml|jpg|png|gif|swf|css|js)$ - [L] </p>
<p> # Allow plain index.php?blah addresses<br />
    RewriteRule ^(index.php.*) - [L]</p>
<p># Replace blah with index.php?page=blah<br />
    RewriteRule ^(.+)$ index.php?page=$1</p>
<h1>Page Code</h1>
<hr />
<p>
    <?php show_source('index.php'); ?>
</p>
<hr />
<p style="text-align: center"><a href="http://the-i.org/" title="t h e - i . o r g | Accept no imitations!"><img style="border: none" src="/test/thei.gif" width="75" height="80" /></a><br />
    <a style="color: green" href="http://the-i.org/" title="t h e - i . o r g | Accept no imitations!"> 
    t h e - <span style="color: red">i</span> . o r g</a></p>
</body>
</html>



t h e - i . o r g