Removing .php file extension with .htaccess file

后端 未结 5 1382
误落风尘
误落风尘 2020-12-10 16:28

I want www.example.com/about.php to just be www.example.com/about

I created an .htaccess file and placed it in the root of my server. I am using linux shared hosting

5条回答
  •  忘掉有多难
    2020-12-10 16:49

    I had this problem also, but I found that this seemed to fix the GoDaddy .htaccess problem.

    # Fix Rewrite
    Options -Multiviews
    
    # Mod Rewrite
    Options +FollowSymLinks
    RewriteEngine On
    RewriteBase / 
    RewriteCond %{REQUEST_FILENAME} !-d 
    RewriteCond %{REQUEST_FILENAME}\.php -f 
    RewriteRule ^(.*)$ $1.php 
    

提交回复
热议问题