Gadianton Posted June 11, 2003 Posted June 11, 2003 I've done this before but never with TCH. I want it so that all my .html files are treated as php files, without changing all the file extensions to .php Has anyone ever done this through cpanel or with a .htaccess file using TCH? If so, please let me know...thanks! Gadianton Quote
surefire Posted June 11, 2003 Posted June 11, 2003 Yes. I've done it successfully at TCH. I used a mod rewrite command in .htaccess Quote
Gadianton Posted June 11, 2003 Author Posted June 11, 2003 Can you please give me the lines in your .htaccess file that do this? Thanks Quote
Gadianton Posted June 11, 2003 Author Posted June 11, 2003 Sorry, I forgot to mention I've already tried: AddType application/x-httpd-php4 .html and it didn't work. Quote
Lianna Posted June 12, 2003 Posted June 12, 2003 Gadianton... Please do not cross-post on the forums. Your post in Open Discussions has been answered by Borfast: http://www.totalchoicehosting.com/forums/i...indpost&p=14938 Most everyone here reads all posts in all forums, so please limit posting a single question a single time, ok? Thanks. Quote
surefire Posted June 12, 2003 Posted June 12, 2003 The force type rule indicated by Borfast in the other thread is the way I would do it. I used a modrewrite rule instead only because the old hosting company I used to host with didn't allow force type. I wrote something close to this: RewriteEngine onRewriteRule ^folder/(.*) http://www.yoursite.com/path/file.php RewriteRule ^folder2/(.*) http://www.yoursite.com/path/file.php This rewrite rule specifically forces server to parse an address like: http://www.yoursite.com/path/folder/345/abcd as http://www.yoursite.com/path/folder.php and then script in folder.php parses the url and pulls out variables using the explode() function. So in this case, var1=345 and var2=abcd It may sound confusing, and it is, but there's plenty of info on the net. Once again, if force type is available (and probably is at a host as awesome as TCH) then that's the way to go. Simple and clean. Follow that other link. Quote
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.