Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    New to the CF scene
    Join Date
    Jul 2007
    Location
    Chicago IL
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question I want PHP to work on .htm without changing the .htm

    I would like to redesign my website from .htm to ‘php. I do not want to loose my page rank or seo. Is there anyway to make php work on .htm. I’m also planning on making new pages in .php. I heard about 401 redirect but have no idea how it works. Can this be done? Can someone please help.

  • #2
    New Coder
    Join Date
    Jul 2007
    Posts
    16
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Put this into your .htaccess file

    AddType application/x-httpd-php .php3 .phtml .php .php4 .html .htm
    PHP and MYSQL
    $string = "3Ip*hKEpanKI#8dmUys&*KqlIJ*P8D";
    $new_string = ereg_replace("[^a-z]", "", $string);
    echo "<a href=http://www.$new_string.org>$new_string</a>";

  • #3
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Use apache redirect

    The above solution is the best

    However you can also use apache redirect as

    RewriteEngine on
    RewriteCond %{REQUEST_URI} ^/url/(.*).html
    RewriteRule ^url/(.*) http://sitename/url/$1.php [L]

  • #4
    New to the CF scene
    Join Date
    Jun 2007
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts
    to redirect page, you use javascript
    Code:
    <script language="javascript">
    	location.href = "index.php";
    </script>

  • #5
    New to the CF scene
    Join Date
    Jul 2007
    Location
    Chicago IL
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts
    What elce do I need in the .htaccess file. I don't have one right now. Do I just make the file and put- AddType application/x-httpd-php .php3 .phtml .php .php4 .html .htm- in the file?

  • #6
    Regular Coder mlse's Avatar
    Join Date
    Mar 2005
    Posts
    624
    Thanks
    20
    Thanked 19 Times in 18 Posts
    You need to check with your host that they allow mod_rewite and/or they allow you to use your own .htaccess. IMO, I wouldn't use the javascript redirect solution because the search engine spiders can probably see that and they won't like it!


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •