Removing www and .php not working.

Discussion in 'Apache' started by Dr.Weed, Dec 10, 2013.

  1. #1
    So I insert following code in my apache.htaccess file in order to remove www and php.

    Whats wrong here?

    This is my whole file

    ErrorDocument 500 /500.php
    ErrorDocument 404 /404.php
    
    # force non-www domain
    RewriteCond %{HTTP_HOST} ^www\.example\.com$ [NC]
    RewriteRule (.*) http://example.com/$1 [R=301,L]
    
    #RewriteEngine on
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ $1.php [QSA,L]
    Code (markup):

     
    Dr.Weed, Dec 10, 2013 IP
  2. chrisranjana.com

    chrisranjana.com Active Member

    Messages:
    132
    Likes Received:
    4
    Best Answers:
    0
    Trophy Points:
    58
    #2
    uncomment #RewriteEngine on

    and push to the top just below the ErrorDocument directive

    and what does the Apache Error Logs say ?
     
    chrisranjana.com, Dec 16, 2013 IP