tags:

views:

72

answers:

3

Are all requests handled in index.php?

+1  A: 

Yes. If you're looking for certain code snippets that handles URL parsing and calls various modules then take a look inside bootstrap.inc

Kuroki Kaze
+3  A: 

Yes. All* requests will go through index.php there is a rewrite rule in the .htaccess file which masks this and gives user friendly urls.

# Rewrite URLs of the form 'x' to the form 'index.php?q=x'.
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]

If Drupal can't invoke these rules then you will see index.php in the browser URL.

*There are cron.php and update.php which don't but these are special files for admin so are not part of the run of the mill site.

Jeremy French
To clarify a bit: The rewriting block first checks if a file of the requested name actually exists on the given path. If it does, it gets called directly. Only if there is no such file will the request be rewritten to call index.php. That's how e.g. cron.php and update.php can be called directly. So it is possible to place other files in the drupal installation folder and call them directly, thus circumventing index.php (and all drupal logic) - not recommended, though.
Henrik Opel
A: 

I would say... no or at least yes with a gotcha.

Only requests that have to do with web pages are handled by index.php. Webservice requests (at least the xmlrpc ones included in the core) are handled by the xmlrpc.php file.

The two files follow the same logic (full bootstrap and then handling the request). One notable difference is that while index.php handles GET and POST requests, xmlrpc.php handles POST only.

There are however no core services that require XMLRPC to be available as a server, so you can safely hide that file from view, if your question had anything to do with security. Some sysadmin are used to rename that file if they need it, in order to protect from bots which know xmlrpc.php is there in standard drupal installations.

As specified by others, cron.php and update.php are also handling requests by their own, but these are used only by the admin of the site or a cronjob living on the server, so they can be given different permissions altogether (again... if your question had anything to do with security).

mac

related questions