Safu Safu - 4 months ago 15
PHP Question

Hide page name in url using htaccess in php

here is my url



www.mydomain.com/index.php/Lg-G-Pro-Lite-D686





In this url i want to hide index.php using htaccess. So result should be



www.mydomain.com/Lg-G-Pro-Lite-D686





Here is my .htaccess file what i tried so far



<IfModule mod_rewrite.c>
Options -Multiviews
Options +FollowSymLinks
RewriteEngine on
RewriteRule ^/ index.php?$1 [L]
</IfModule>





After this i am getting 404 not found . Please help me to solve this problem.

Answer

here you go

RewriteRule ^(.*) index.php?$1 [L]