Jump to content

Rewriting urls using preg_match


peuge

Recommended Posts

Do you have a fuller explanation of what it is you're attempting to achieve in terms of rewriting urls?

Usually .htaccess is used to interpret a url into another before it is passed to PHP.

 

e.g.

RewriteEngine on

Options +FollowSymLinks

 

RewriteRule index.php - [L]

RewriteRule . /index.php [L]

 

The above will redirect ALL urls to index.php, which is where I would expect your front controller (or dispatcher) so take the URL and chop it up into namespace/controller/action/params

 

Also, the 1st rewriterule specifies that if you asked for index.php, do nothing, the 2nd says if you supplied ANY url that contains characters then go to index.php

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.