Jump to content

.htaccess rewriting through 'it' query param


Mike Rockett
 Share

Recommended Posts

Just curious as to why all requests that are sent to index.php are routed through the it GET param...

RewriteRule ^(.*)$ index.php?it=$1 [L,QSA]

Any particular reason why it isn't simply this:

RewriteRule ^(.*)$ index.php [L,QSA]

Or even this:

RewriteRule ^ index.php [L,QSA]

?

Link to comment
Share on other sites

  • 2 months later...
  • 2 weeks later...

I am a newbie to ProcessWire, so I am only guessing here based on my experience with other CMS's...

The requested path needs to be provided to the processwire system somehow, so it knows what page to show. If you're not using a CMS or a framework, then usually what is served to the browser is a php or html file that exists at the requested path... but with a CMS like processwire, there aren't actual files on the server for all the pages that are created in the dashboard. So instead, ALL requests for all paths are sent to the processwire system, and it examines what the requested path was and retrieves the appropriate content from the database based on that. The "it" variable is how the requested path is communicated to processwire from apache. I've seen other systems use a different approach, using php's $_SERVER['PATH_INFO'] , but sometimes this causes problems depending on the server settings, so perhaps processwire avoids this method to cut down on potential problems.

  • Like 1
Link to comment
Share on other sites

  • 4 months later...

Once again, I don't know how I missed the first reply... Sorry about that.

@mrjasongorgman - Yeah, I just don't see it often anywhere. There has to be a really good reason for it...

@jordanlev - The paths would be routed to PW with both methods. Only trying to figure out why it goes through a GET param...

Anyways, it works - so I couldn't complain. That said, I'd love to know the reason.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...