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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Sep 2004
    Posts
    8
    Thanks
    0
    Thanked 0 Times in 0 Posts

    New to mod_rewrite

    As far as i know, mod_rewrite can do this..

    Say for example, i have a page at
    Code:
    http://www.mysite.com/folder/page.php
    and i want to use it as my main index, so people will see it when they enter
    Code:
    http://www.mysite.com/
    I dont want any other pages in the /folder/ directory affected.

    Can .htaccess mod_rewrite do that? And if so, how?

  • #2
    cfc
    cfc is offline
    Regular Coder
    Join Date
    Dec 2004
    Location
    Keswick, Ontario
    Posts
    251
    Thanks
    0
    Thanked 0 Times in 0 Posts
    I don't have any experience with mod_rewrite personally, but these links should prove useful (it was a 2-minute google search for the keywords: "mod_rewrite"+"url"):

    Official apache documentation of mod_rewrite:
    http://httpd.apache.org/docs/mod/mod_rewrite.html

    Apache URL rewriting guide:
    http://httpd.apache.org/docs-2.0/misc/rewriteguide.html

    Another (less complicated) guide to URL rewriting with mod_rewrite:
    http://powersitesystem.com/article1.html


    The third will probably prove the most useful if you are just looking for a simple guide to URL rewriting and aren't too experienced with configuring apache or have little interest in getting very deep into the functions of mod_rewrite

  • #3
    Regular Coder
    Join Date
    Feb 2005
    Location
    UK
    Posts
    133
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Here, you can use this:

    RewriteEngine On
    RewriteRule ^index.php /folder/page.php

    And assuming the index.php is the default page when someone goes to http://yoursite.com/ it will look like they're at /folder/page.php

    If you want to redirect them there just add a [R] on the end


  •  

    Posting Permissions

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