Jump to content

Recommended Posts

mod rewrite is nothing to do with PHP. If your .html files contain PHP code then your PHP code wont be parsed, unless your server is configured to parse .html files as PHP. If your server is not configured to parse .html files as PHP then you'll have to configure your server to do so, if you don't want to convert your .html files to .php files. What you might be able to do is add the following line to a .htaccess file within your websites root:

AddType application/x-httpd-php .html

If your host allows you to change the servers configuration via .htaccess then you should find your .html files are now being parsed by PHP. You can test this by creating a simple test html file with the following code:

<?php phpinfo(); ?>

When you run test.html you may find that you'll get a full of page of info about PHP's configuration/environment. If you don't then you'll need to convert your .html files to .php instead.

Thanks for the reply. Actually, I'm changing all my pages to .php extension. However there are many links pointing to various pages with .html extension. What I want to do is simply make sure that anyone who clicks on a link pointing to /page.html gets redirected to /page.php

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.