You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Peter Harkins <ph...@s8s.info> on 2002/04/14 21:33:41 UTC

passing PATH_INTO to script

	I've got a PHP script named 'index' in my webroot that needs to
access PATH_INFO. If I call it as 'http://example.com/index/option1' it
works fine, but I'd really like to be able to call it as
'http://example.com/option1'.
 
	My .htaccess looks like
DefaultType application/x-httpd-php
DirectoryIndex index index.php index.html
<Files ~ "^\.ht">
        Order allow,deny
        Deny from all
</Files>
 
	I tried adding 'ErrorDocument 404 /index', but this doesn't preserve
PATH_INFO. I've tinkered with mod_rewrite, but it's pretty hairy and I don't
really understand it. This is what I've come up with, but it doesn't work so
I'm guessing I'm just missing something about how it works. Can anyone fix
this rewrite rule or suggest another method of doing it?
 
RewriteEngine   on
RewriteCond     ^/(.+)  !-f
RewriteRule     ^/(.+)  /index/$1

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org