简体   繁体   中英

Loading index.php from the root directory for every request in IIS

I'm on a shared IIS host, and I honestly have no idea how I would accomplish this. The index.php page is in the root directory of the host, and rather than creating directories for every single page, is it possible to load index.php for every single page request?

Example:

User requests http:foo.com/bar/ (the "bar" directory does not exist in the root folder)

Server serves http://foo.com/index.php whether the directory exists or not.

I'm used to Apache's method of doing this through htaccess, but I have absolutely no idea how I would accomplish this in IIS. The only workaround that I can imagine that doesn't involve htaccess is setting the 404 error page to /index.php, but this prevents GET variables from being passed through the URL. Thanks!

I'm new to php, and I've only messed with apache, but can you redirect you 404 page to index.php?

sorry if this makes me sounds like a noob.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM