Jump to content

different file extension (.html) with php setup


Recommended Posts

Ok, so I have a fully working PHP installation running on Windows 2003 Server with IIS 6. This is not my choice, as it seems more common with more support for running PHP with Linux and Apache.

 

Anyhow, the issue is that I need 301 Redirects for specific files with the extensions in .html. However, with HTML files you can't set headers, thus I'm forced to process all .html files as php files so headers can be set using PHP.

 

Problem is, I tried adding the .html file extension to the "mapping" in IIS to the isapi file and it does not work. This is where I set the .php file extension for PHP processing in the past and expected a similar behavior. I made sure to select "All verbs" and checked "script engines" and "verify that file exists".

 

Any suggestions?

Link to comment
Share on other sites

Guest prozente

Adding .html to be processed would add a decent amount of overhead if you have a lot of static files.

What I would probably do instead is add index.php to the list of index files. Then say you have a file foobar.html that you need a 301 for, create a directory with the name foobar.html then inside the directory put an index.php file with your 301 header code.

Link to comment
Share on other sites

I apologize for not seeing your post earlier, for some odd reason my browser kept displaying a cached page (even with the setting, check for changes eery time I access a page).

 

The problem is that the url have to have the .html extension. I realize that it adds quite a bit of overhead, but most of our pages are .php or .htm. I purposely picked .html for this as there were only two options.

 

However, your suggestion sounds like a trick that would work. I will give it a whirl.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

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

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

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

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.