0

I have revamped my website from WordPress to PHP. Now every url with no extension are showing a 404 error page. I have checked with many redirect codes but all are not working. Please suggest a solution for this.

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME}\.php -f
RewriteRule ^(.+)$ $1.php [L,QSA]
Abhishek Gurjar
  • 7,426
  • 10
  • 37
  • 45

1 Answers1

0

Try this:

//Rewrite to www
Options +FollowSymLinks
RewriteEngine on
RewriteCond %{HTTP_HOST} ^example.com [nc]
RewriteRule ^(.*)$ http://www.example.com/$1 [r=301,nc]
arghtype
  • 4,376
  • 11
  • 45
  • 60