Bharanikumar
Bharanikumar

Reputation: 25733

URL Rewrite problem

RewriteEngine on

RewriteRule bharani $ index.php

in my .htaccess file .

The above small snippet throwing 500 internal Server Error ,

Upvotes: 1

Views: 209

Answers (4)

Tom
Tom

Reputation:

RewriteRule ^index/result_id/([0-9]+)/?$ index.php?result_id=$1


RewriteRule ^index/article/([0-9]+)/?$ articles.php?article_id=$1

RewriteRule ^index/product/([0-9]+)/?$ products.php?productid=$1

Would be the best to do

Upvotes: 2

Tom
Tom

Reputation:

Something like this:

RewriteRule ^index/([a-zA-Z_-]+)/([0-9]+))/?$ index.php?result_id=$2

or

RewriteRule ^index/result_id/([0-9]+))/?$ index.php?result_id=$1

Upvotes: 0

Tom
Tom

Reputation:

Try

RewriteRule ^/bharani/?$ index.php

The /? means that the / is optional. Just incase people don't put it in.

Upvotes: 1

Fidi
Fidi

Reputation: 5834

You may not use whitespaces in your regex. Try to cut the space between "bharani" and "$".

Upvotes: 1

Related Questions