0

There is my site

For SEO I have removed the .php extension from all links. Now I want to add .php extension using .htaccess file. How I can do this. I do not have any idea of using htaccess

2 Answers 2

1

Use MultiViews

Let Apache do this for you.

Put this in your .htaccess file:

Options +MultiViews
2
  • 1
    XAMPP is an Apache distribution, essentially. So yes, this will still work.
    – poncha
    Jun 21, 2012 at 8:38
  • Quote from XAMPP site: XAMPP is an easy to install Apache distribution containing MySQL, PHP and Perl
    – poncha
    Jun 21, 2012 at 8:39
0
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^someName-([0-9]+)\.html$ someName.php?id=$1 [NC]

this will forward */someName-f435weS.html to someName.php?id=f435weS

source: http://roshanbh.com.np/2008/02/hide-php-url-rewriting-htaccess.html

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.