Web Hosting Talk







View Full Version : always call index.php no matter of uri


iplexx
06-29-2001, 11:23 AM
Hi,

I guess this is more an apache question, but I didn't find the appropriate directive, and maybe anyone knows...

I want that no matter what URI is called on a domain that always the /index.php file is called, without a modified URL.

ie. if someone calls http://www.mydomain.com/anything/hello.php
the httpd should fetch mydomain.com/index.php instead but not modify the URL.

I disabled the raqs rewrite stuff, and tried around with ErrorDoc directive in httpd.conf & .htaccess, but this modifies the URL and it's only possible to get the original URL with HTTP_REFERER but not HTTP_URI

Thanks,
Martin/Iplexx

iplexx
06-30-2001, 01:52 PM
No one?

I think it should be rather easy by a rewrite rule, but I don't get it working

RewriteRule ^/(.*) http://%{HTTP_HOST}/index.php?$1 [L,R]

I read the tutorial http://httpd.apache.org/docs/misc/rewriteguide.html and the doc http://httpd.apache.org/docs/mod/mod_rewrite.html but I'm simple to stupid... ;)

Chicken
06-30-2001, 02:03 PM
I misread your question and (yesterday) typed a whole bunch of stuff that didn't apply until I read it again and realized what you were asking. I have no clue how to set it so when one URL is reached (one file) it returns the contents of another yet still displays the URL (or file path, whatever you want to call it), typed.