ForceType versus mod_rewrite
Moderator: General Moderators
ForceType versus mod_rewrite
This is slightly related to my Front Controller thread:
I'm trying to figure out the advantages/disadvantages of using ForceType versus mod_rewrite to generate clean URLs. (I'm leaving out the custom 404 method as I feel its polluting of the error log is a strong enough disincentive.)
I've been using ForceType so far, but one little details is making me want to explore mod_rewrite. Most tutorials I've seen only list one or the other and don't go into details as to their trade-offs.
Assuming you have sufficient control of httpd.conf and/or .htaccess, what are the pros/cons?
As I see it:
ForceType:
Pros: Simpler, less processing?
Cons: Extentionless scripts confuse phpDocumentor, configuration can get more psread out
and the flip for mod_rewrite.
I'm trying to figure out the advantages/disadvantages of using ForceType versus mod_rewrite to generate clean URLs. (I'm leaving out the custom 404 method as I feel its polluting of the error log is a strong enough disincentive.)
I've been using ForceType so far, but one little details is making me want to explore mod_rewrite. Most tutorials I've seen only list one or the other and don't go into details as to their trade-offs.
Assuming you have sufficient control of httpd.conf and/or .htaccess, what are the pros/cons?
As I see it:
ForceType:
Pros: Simpler, less processing?
Cons: Extentionless scripts confuse phpDocumentor, configuration can get more psread out
and the flip for mod_rewrite.
- feyd
- Neighborhood Spidermoddy
- Posts: 31559
- Joined: Mon Mar 29, 2004 3:24 pm
- Location: Bothell, Washington, USA
I'd tend to swing at mod_rewrite, because:
- more flexible, you could have it run a script to "help" determine the thing to send
- it's regex, I love regex, as you may know.
however:
- can be somewhat painful to deal with depending on what you want to do (unless you send everything through a script, then it can get a lot easier)
Dunno.
I'd say they are kinda even.
- more flexible, you could have it run a script to "help" determine the thing to send
- it's regex, I love regex, as you may know.
however:
- can be somewhat painful to deal with depending on what you want to do (unless you send everything through a script, then it can get a lot easier)
Dunno.
I'd say they are kinda even.
What do you mean by this? Are you saying you can use mod_rewrite to direct all traffic through a single script? If so that's also true for the ForceType approach. If not, can you explain a little more of what you mean?feyd wrote:I'd tend to swing at mod_rewrite, because:
- more flexible, you could have it run a script to "help" determine the thing to send
Heres a very simple one, and may not work depending on what your doingTodd_Z wrote:Can i see the .htaccess code for sending urls through a script with the mod_rewrite method? Sounds interesting.
Code: Select all
RewriteEngine on
RewriteRule !\.(gif|jpg|png|css|js)$ /home/nthitz/public_html/index.php