I've numerous index.php scripts using Search engine optimization-friendly arg format like

example.com/path/to/index.php/opt/arg

and want to rewrite or pressure a handler to possess

example.com/path/to/ih/opt/arg

and therefore shorten the index.php part. [Well, Let me eliminate it entirely, try not to want to return to

example.com/path/to/?opt&arg

format.] This ought to be generally supported in almost any dir on the website instead of needing .htaccess, alias, or http.conf modification. For my next trick I'll expand 'ih' for PHP also to cover 'ip' for Perl, 'ir' for Ruby, 'iy' for Python, and possibly others. [My original thought only agreed to be 'i' however I recognized that you will find other languages that I'll want this too.]

I have attempted having fun with MultiViews but clearly have no idea what I am doing :-) I have looked extensively at mod_rewrite but simply can't observe how to implement something similar to this. I required a fast take a look at forcing a handler but 1) am unsure that's really what i'm saying (therefore i beg forgiveness ahead of time for possibly while using wrong term) and a pair of) possess the added fun challenge of running 1.3 where I host versus 2.2 in your own home :-)

Suggestions?

TIA &lifier Hands

:-D

David T-G http://justpickone.org/davidtg/email/

Because you investigated using mod_rewrite, I am likely to assume you do not mind creating a one-time switch to .htaccess or httpd.conf, but simply don't wish to need to do it for each index.php in your site. (Correct me if I am wrong!)

Do this:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*\/)?ih(\/.*)?$ $1index.php$2 [L,QSA]

You might not require the two RewriteConds. They simply make sure that the initial URL didn't exist being an actual file around the system, before spinning that URL.