Hi,
i am interested in knowing how the alias's in drupal work. Everything from what i understand passes through the index page does that mean that drupal looks for the /something in the various different tables and if it doesn't find it it then searches the alias table etc

or does it write all these alias to .htaccess or something?

thanks

Comments

yelvington’s picture

Aliases are stored in the database. When Drupal receives a page request it checks for an alias and passes the true internal path through to the router component, which invokes the appropriate page callback.

geofreybiggins’s picture

thanks i guess i was meaning more of how the flow of drupal works to be able to output that.

eg normally if i had a site it would have index.php for example if i wanted to find something from the database i'd do a query eg

/index.php?alias=XXX

but obviously there is no index.php being shown so i guess .htaccess is 'removing' index.php and a query is being run to look into the alias table and see if something exists and if so show it. But surely there are other things to take into consideration eg a folder further down like /folder/index.php so it would also have to check that the folder doesn't exist.

Is there a running order of what drupal queries when a page is called?

P.S am a bit confused why this forum has a subject box for replies?? never seen a forum like this before.

jaypan’s picture

If Clean URLs are enabled in Drupal, then the .htaccess file rewrites the URLs to remove index.php.

Example. Without Clean URLs enabled: www.example.com/index.php?q=node/1
With clean URLs enabled enabled: www.example.com/node/1

So the index.php?q= is removed.

The order that the processing happens is:
1) Does a file exist for the supplied URL?
Yes - show that file
No - rewrite the URL and search the database for the given path.

Contact me to contract me for D7 -> D10/11 migrations.