Justtechjobs.com Find a programming school near you






Online Campus Both


php-general | 2000071

[PHP] Having problem hiding PHP scripts with Apache's mod_rewrite. From: Adam Prall (adam <email protected>)
Date: 07/10/00

Hi everybody;

I'm trying to hide a script name in a URL so that I can access
information like this:

http://www.myserver.com/folder_containing_php_script/category/subcategory/keyword

So that, the Apache server actually goes to

http://www.myserver.com/folder_containing_php_script/index.php

and then my script (which works correctly), splits the remainder of the URL:

/category/subcategory/keyword

into variables ($category =
'category',$subcategory='subcategory',$keyword='keyword'). That all
works fine, except that I can no longer get my Apache server (running
under FreeBSD unix 4.0) to use the .htaccess file I put in this
directory:

folder_containing_php_script/.htaccess

...to rewrite the url, so someone always gets an error if they try to
go to that (obviously) bogus url (there is of course no folder called
category/subcategory/number). To make the script work, I have to type
a url like this into my browser:

http://www.myserver.com/folder_containing_php_script/index.php/category/subcategory/keyword

... and people can see the name of the php script in there. I don't
want that!! Does someone know the answer to hiding it? Thanks, Adam

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe <email protected>
For additional commands, e-mail: php-general-help <email protected>
To contact the list administrators, e-mail: php-list-admin <email protected>