Forum Moderators: phranque
Are you trying to use mod_rewrite directives in httpd.conf, in conf.d, or in .htaccess? On Windows, you must change the name of the .htaccess file to something else, and declare the new name using AccessFileName in httpd.conf or similar server config file (See [httpd.apache.org...]
Did you enable mod_rewrite with the required Options +FollowSymLinks (or Options SymLinksIfOwnerMatch), and RewriteEngine on directives?
"Not working" doesn't tell us enough to help. How did you test and what were your test results, specifically?
Jim
switch($p) {
case 'page1':
// if $p = page1 i.e url was something like test.php?page=page1
switch($q) {
case 'boo':
//if $p=boo then url is somehting like test.php?page=page1&var=boo
echo "<h2>This is page1 And BOO</h2><br />";
break;
case 'foo':
echo "<h2>This is page1 And FOO</h2><br />";
break;
default:
// if $p = page1 i.e url was something like test.php?page=page1
echo "<h2>This is page1</h2>";
break;
}
break;
case 'page2':
// if $p = page2 i.e url was something like test.php?page=page2
echo "<h2>This is page2</h2>";
break;
case 'page3':
// if $p = page3 i.e url was something like test.php?page=page3
echo "<h2>This is page3</h2>";
break;
case 'page4':
// if $p = page4 i.e url was something like test.php?page=page4
echo "<h2>This is page4</h2>";
break;
default:
// if page != any of the above, then default is executed
echo "<h2>This is the Default Page</h2>";
break;
}
?>
and here is the .htaccess code
RewriteEngine On
RewriteRule ([^/]+)/(.*)\.html$ test.php?page=$1&var=$2 [L]
RewriteRule ^(.*)\.html$ test.php?page=$1 [L]
===
I can call the test.php page
normally with test.php?page=page1
or just page1.html
but its not working with easy php3,
however its working fine when I upload it to my online linux server.