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

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

Post Reply
davidtube
Forum Commoner
Posts: 79
Joined: Sun Mar 25, 2007 8:42 pm

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

Post 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?
User avatar
seppo0010
Forum Commoner
Posts: 47
Joined: Wed Oct 24, 2007 4:13 pm
Location: Buenos Aires, Argentina

Post by seppo0010 »

Does this work for you?

Code: Select all

RewriteEngine on
RewriteCond $1 !^(index\.php|images|robots\.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]
davidtube
Forum Commoner
Posts: 79
Joined: Sun Mar 25, 2007 8:42 pm

Post 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".
User avatar
Zoxive
Forum Regular
Posts: 974
Joined: Fri Apr 01, 2005 4:37 pm
Location: Bay City, Michigan

Post 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.
Post Reply