Forum Moderators: coopster

Message Too Old, No Replies

Mod_Rewrite versus Htaccess file

Pros and Cons of Mod_Rewrite versus ForceType command

         

Storyman

1:34 am on Jan 4, 2004 (gmt 0)

10+ Year Member



Mod_Rewrite versus using .htaccess with Forcetype command.

After reading several threads here and elsewhere about Mod_Rewrite it seemed like the answer to making the URLs search engine friendly.

Then articles using a '.htaccess' file with the ForceType command began to appear and quite frankly seems like a simpler and more secure way to go:

<Files FileName>
ForceType application/x-httpd-php
</Files>

After a Google search for "ForceType application/x-httpd-php" numerous articles on the subject make it appear to be the preferred method for rewriting search engine friendly URLs.

Now I'm bewildered and poised on the edge of paralysis by analyses.

Can someone provide the pros and cons of the two alternatives?

jamie

8:45 am on Jan 4, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



hi storyman,

i think you got your wires crossed a bit ;-)

* you could use mod_rewrite for instance to make long query strings look like a standard directory structure. this makes it easier for search engines and people alike to make sense of your URLs

* forcetype on the other hand instructs your webserver to treat a certain file as a php file.

e.g.

<Files news.html>
ForceType application/x-httpd-php
</Files>

this means the file news.html would be be parsed as a php file and could contain php code.

this sitepoint article [sitepoint.com] explains it very well

good luck

<added>Welcome to Webmasterworld! ;-)

Longhaired Genius

11:55 am on Jan 4, 2004 (gmt 0)

10+ Year Member



That article is a useful read but it seems to me that it misses the point in a big way. It deals with achieving search engine friendly urls if you are writing every line of the software you will be using yourself and can plan your scheme from the start. But most people, when they come to consider static urls, will be using a forum or content management system written by someone else. And in that case, the simplest and most elegant course of action is to rewrite the urls with Mod_Rewrite.

Storyman

5:17 pm on Jan 4, 2004 (gmt 0)

10+ Year Member



Thanks for the info. It clears the dust storm that was kicked up by the information overload created by all of the articles I've been reading. Mod_Rewrite it is then.