Jump to content

Mod_Rewrite not working


oshopindia

Recommended Posts

I write following code:

 

RewriteEngine On

RewriteBase /grabkkkart1/  
RewriteRule productdetail/(.*)/(.*)/$ /productdetail.php?$1=$2

RewriteRule ^index.php$ http://www.grabkart.com/ [R=301]

 

Here, The second RewriteRule ^index.php$ http://www.grabkart.com/ [R=301] is Working and it's Redirecting from http://www.grabkart.com/index.php

to http://www.grabkart.com

 

But The first RewriteRule RewriteRule productdetail/(.*)/(.*)/$ /productdetail.php?$1=$2 Not Working

 

I want to convert http://www.grabkart.com/productdetail.php?prodid=59

to

http://www.grabkart.com/productdetail/prodid/59

Here, The second RewriteRule ^index.php$ http://www.grabkart.com/ [R=301] is Working and it's Redirecting from http://www.grabkart.com/index.php

to http://www.grabkart.com

Not for me it isn't. In fact it shouldn't work period because you've created an infinite loop of redirects.

Add a line at the bottom of your .htaccess saying

TestDirective 1
Do you get a 500 error when trying to browse your website?

 

Oh, and next time you post code, use

 tags.

<?php if( !function_exists('apache_get_modules') )

{ echo "mod_rewrite not enable"; }

else(function_exists('apache_get_modules') )

{ echo "mod_rewrite enable"; }

?>

 

I write This code For To know mod_rewrite enable or not on my server

Is This code True It is showing "mod_rewrite not enable"

In My .htaccess

 

ErrorDocument 404 http://www.grabkart.com/

rule is working But

 

RewriteRule ^productdetail/([^/.]+)/?$ productdetail.php?prodid=$1 [L]

Rule is not working I don't Know why

 

This Both Rule You can see in

http://www.branded3.com/blogs/htaccess-mod_rewrite-ultimate-guide/

 

Here is my .htaccess file

 

 

 

# Do not remove this line, otherwise mod_rewrite rules will stop working

RewriteBase /grabkkkart1

Options +FollowSymLinks
RewriteEngine on
ErrorDocument 404 http://www.grabkart.com/
RewriteRule ^productdetail/([^/.]+)/?$ productdetail.php?prodid=$1 [L]

I want to Convert

http://www.grabkart.com/productdetail.php?prodid=3560

to

http://www.grabkart.com/productdetail/3560

 

But my RewriteRule

RewriteRule ^productdetail/([^/.]+)/?$ productdetail.php?prodid=$1 [L]

Not Working

 

On Productdetail page I use 3560 use by get methode

So does get methode effect the RewriteRule

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.