trying to hide .php extension in .htaccess

Discussion in 'HTML & Website Design' started by VolkanSEO, Jun 11, 2012.

  1. #1
    Hi i am working on a website that had no .htaccess previously.
    site only opens with extension domain.com/abc.php but i want it to be domain.com/abc

    I have searched some forums added some to my htaccess but so far i m insuccessful. I m keep getting my 404 error

    Below is my .htaccess.
    Please help me out


    Options +FollowSymlinks
    RewriteEngine on
    rewritecond %{http_host} ^aieus\.com [nc]
    rewriterule ^(.*)$ http://www.aieus.com/$1 [r=301,nc]


    ## EXTENSION REWRITE HIDE PHP#
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILENAME}\.php -f
    RewriteRule ^(.*)$ $1.php


    ## Errors ##
    ErrorDocument 404 /404.php
     
    VolkanSEO, Jun 11, 2012 IP
  2. Altfuns

    Altfuns Member

    Messages:
    12
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    36
    #2
    Try this:

    RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteRule ([\w]{1,9}) $1.php [QSA]
     
    Altfuns, Jun 11, 2012 IP
  3. VolkanSEO

    VolkanSEO Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    @Altfuns I tried and no it's not working
     
    VolkanSEO, Jun 11, 2012 IP
  4. VolkanSEO

    VolkanSEO Peon

    Messages:
    34
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I found the problem. Let me explain it to those that have similar problem.

    First my issue was related to Godaddy Hosting.

    So, addition to the post above
    I added :

    #Fix Rewrite
    Options -Multiviews

    to fix the problem.
     
    VolkanSEO, Jun 11, 2012 IP