Page 1 of 1

hiding "index.php" in www.blah.com/index.php/Games

Posted: Thu Nov 08, 2007 12:25 pm
by davidtube
I spent ages trying to work out mod rewrite but never could so I'm using php to explode the URLs, but I can't manage to get http://www.blah.com/Games to work, only http://www.blah.com/index.php/Games seems to work.

Any advice?

Posted: Thu Nov 08, 2007 12:28 pm
by seppo0010
Does this work for you?

Code: Select all

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Posted: Thu Nov 08, 2007 1:17 pm
by davidtube
Sorry. I can't get mod rewrite to work at all. I'm trying to do it all with just php.

The code I have is:

Code: Select all

if(isset($PATH_INFO)) {   
      $vardata = explode('/', $PATH_INFO);
        $urlcat=$vardata[1];
		$urlsubcat=$vardata[2];
		}
which works if the URL includes "index.php" but it won't work for simply, "www.blah.com/animals/dogs".

Posted: Thu Nov 08, 2007 3:34 pm
by Zoxive
davidtube wrote:Sorry. I can't get mod rewrite to work at all. I'm trying to do it all with just php.

The code I have is:

Code: Select all

if(isset($PATH_INFO)) {   
      $vardata = explode('/', $PATH_INFO);
        $urlcat=$vardata[1];
		$urlsubcat=$vardata[2];
		}
which works if the URL includes "index.php" but it won't work for simply, "www.blah.com/animals/dogs".
... Because you need mod rewrite for that to work.