0

I have created an application in PHP MVC,and the http request was like domain.com/index.php?controller/action, i want to remove index.php? and the final url looks like http://domain.com/controller/action. Any help will be highly appreciated

currently my .htaccess file looks like below

RewriteEngine On
RewriteBase /
<IfModule mod_rewrite.c>
# Removes index.php from ExpressionEngine URLs
RewriteCond $1 !\.(gif|jpe?g|png)$ [NC]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

it only removes the index.php and the url become http://domain.com/?controller/action, i want that "?" to be off from the url.

tereško
  • 58,060
  • 25
  • 98
  • 150

1 Answers1

1

use mod_rewire module to get the job done. What you are asking is SEO friendly URLs. If you search search a bit you will find a lot of examples.

put this in your root .htaccess file.

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?/$1 [L]
Techie
  • 44,706
  • 42
  • 157
  • 243
  • Thanks for your reply!! I tried it, but it only removes the index.php and the url become http://domain.com/?controller/action, i want that "?" to be off from the url. – Anoop Sankar Jan 24 '13 at 12:11