LoadModule rewrite_module modules/mod_rewrite.so
And when I do phpinfo(), I see mod_rewrite in the loaded modules box.
My directory structure: I'm using Apache, so there's a htdocs directory. Inside the htdocs directory I have myProject directory. This is the root of my site. Within the my Project directory I have all the files and folders that make up my site. Sitting right in this "root" myProject directory I created a .htaccess file (making sure that it doesn't have a .txt type).
Here's the contents of this file:
RewriteEngine On
RewriteBase /
RewriteRule .* index2.php
And here's index2.php (which is located right in myProject):
<?php
echo "hiiii";
class Foo {
static public function test($classname)
{
if(preg_match('/\\\\/', $classname))
{
$path = str_replace('\\', '/', $classname);
}
else
{
$path = str_replace('_', '/', $classname);
}
if (is_readable($path.".php"))
{
require_once $path .".php";
}
}
}
spl_autoload_register('\Foo::test');
\controller\Controller::run();
?>
So no matter what I do, this index2.php file should be run, right? Well it's not. I know it's not because I'm getting no echo of hiiii unless I physically go to index2.php.
What could be going wrong?
Thanks!
EDIT:
Just want to make a note that I believe the problem is that the .htaccess file is not being read at all. Here's why I think that:
I updated the .htaccess file to say this:
RewriteEngine On RewriteBase / This is garbage RewriteRule /.* index2.php
This should throw a 500 internal server error, should it not? Well it doesn't. When I go to this url:
http://localhost/myProject/i
I am just getting a 404 Not Found Error screen.
This post has been edited by eZACKe: 07 February 2012 - 07:26 AM

New Topic/Question
Reply




MultiQuote




|