The Lodge is members-only design/dev videos and Office Hours.

Next Office Hours Session: "Implementing an SVG Icon System" Nov 30 - 6:00 PM Eastern

.htaccess and the rewriteRule

  • # September 16, 2009 at 12:25 pm

    In order to get php code to work in my html site I was given this by a very helpful chap who is unable to help me further.

    rewriteRule ^index.html /index.php

    And to make a couple of changes like renaming my index.html file to index.php.

    This was so that I can run yahoo pipe php code for rss feeds on my site. The home page works just fine.

    Now I need to extend this to other pages on my site that are currently using the javascript badge of pipes….not so good.

    Being a rank novice (I took over the site and am learning) I am on a steep learning curve.

    To get my other pages to work can I add them to the code above in the .htaccess file like this

    rewriteRule ^index.html /index.php
    rewriteRule ^file1.html /file1.php
    etc for each file

    Or am I way off here.

    Of course I would need to rename file1.html to file1.php etc

    And since file1 etc is not in the root directory how do I reference the path correctly in the rewriteRule ^etc?



    # October 14, 2009 at 4:01 am


    Please find the following link, … developer-
    In this we can able see the 16 points.
    Please find the steps.

    Thanks & Regards

    # October 14, 2009 at 5:45 am

    Thanks very much for this. We have installed and are busy doing the Joomla thing :-)Hopefully one of these fine days we will have the site Joomla-fied. Ourmain site comes forst though.



    # October 14, 2009 at 1:32 pm

    Best of luck with Joomla thing.

    In the meantime you may be interested to know that:

    RewriteEngine On
    RewriteRule ^([A-Za-z0-9-]+).html$ $1.php [L]

    will redirect all .html requests to a file of the same name ending in .php

    Hope that helps you,

Viewing 4 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed