Jump to content

Recommended Posts

Posted

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

Posted

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 on

RewriteRule ^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.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...