Need a quick tip with .htaccess

Discussion in 'Programming' started by pavelbarchuk, Jul 10, 2009.

  1. #1
    my website is in this format, website.com... On all inner pages, when you click home, it goes to website.com/index.php

    is there a rewrite rule that i can make the /index.php turn into just website.com?

    Thanks in advance
     
    pavelbarchuk, Jul 10, 2009 IP
  2. techbongo

    techbongo Active Member

    Messages:
    309
    Likes Received:
    3
    Best Answers:
    0
    Trophy Points:
    80
    #2
    Yes, you can use this code and save it in a .htaccess file and upload it to the web root folder of your server.

    Options +FollowSymLinks
    RewriteEngine on
    RewriteRule index.php /
    Code (markup):
     
    techbongo, Jul 10, 2009 IP
  3. pavelbarchuk

    pavelbarchuk Peon

    Messages:
    163
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    If i add your code, i get a internel server error. Where in the code below would it go?

    
    <IfModule mod_rewrite.c>
    RewriteEngine On
    #RewriteRule ([([^0-9a-zA-Z\_\-]*)\.htm([l]?)$ details.php?id=$1 [L]
    RewriteRule ^used-(.*) details.php?id=$1 [L]
    RewriteCond %{HTTP_HOST} ^www.portlandsauto.com$ [NC]
    RewriteRule ^(.*)$ http://portlandsauto.com/$1 [L,R=301]
    
    Code (markup):
     
    pavelbarchuk, Jul 10, 2009 IP