0

Hi All....

I have developed a portal in mvc and i am having problem in making the links SEF...
right now if i need to access controller and method i am following

www.xxxxxxxx.com/index.php?rt=CONTROLLER_NAME/METHOD_NAME

i want to make the above link SEF like
www.xxxxxxxx.com/CONTROLLER_NAME/METHOD_NAME

Below code i have it in my .htaccess file but when i tried to run it its saying INTERNAL SERVER ERROR

.htaccess

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]

4
Contributors
5
Replies
9
Views
4 Years
Discussion Span
Last Post by Squidge
0

I agree with radow here. There's nothing syntactically wrong with your rewrite conditions or rule. The HTTP 500 error you're receiving is likely because mod_rewrite is not enabled. Do you have any other configuration details in your .htaccess file that may be causing the 500 error? If not, I would change your rewrite body to this:

<IfModule mod_rewrite.c>
  RewriteEngine On
  RewriteCond %{REQUEST_FILENAME} !-f
  RewriteCond %{REQUEST_FILENAME} !-d
  RewriteRule ^(.*)$ index.php?rt=$1 [L,QSA]
</IfModule>

If the 500 error stops occuring then you've confirmed mod_rewrite is not enabled. Either enable it in your Apache configuration or contact your host to do it for you.

0

@Deepak,

Once you have confirmed re write is enabled, you also need to set your base:

RewriteBase / = these makes "/" the return for where all rewrites will start from. Looking at what you have posted this is a key item that is missing.

Also for the rule itself:

RewriteEngine On
RewriteRule ^([^/]*)$ /index.php?rt=$1 [L]

I hope that helps

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.