Jump to content

Mod_Rewrite not working


oshopindia

Recommended Posts

To check that mod_rewrite is enabled to your domain (I'm pretty sure it is) , create .htaccess and display.php files inside web root or your current working directory.

 

.htaccess

RewriteEngine On
RewriteRule ^.*$ display.php

display.php

<?php
print 'mod_rewrite works fine!';
?>

Every request like (domainName/index.php) should be redirected to display.php file!

No!

 

Your application uses links like:

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

If you try to rewrite that link to "http://www.grabkart.com/prodid/9449" , this link won't be real for your app.

 

Re-read my reply #25.

When I apply You reply #25

 

It shows :

Not Found

The requested URL /grabkkkart1/productdetail/4385 was not found on this server.

Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache Server at www.grabkart.com Port 80

Ya When I Click On That Link It Redirect to

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

 

We Have Multiple hosting Facility in Our Godaddy Server

My Website Grabkart.com is in grabkkkart folder But we also have Separate Ftp For my This site

 

Here is my site's structure

/

index1.php

productdetail.php

 

index1.php and productdetail.php Both files are under One root / directory

You can Open

http://www.grabkart.com/index1.php

 

And I write <a href="./productdetail/<?=$row_prod['product_id']?>"> on all images

 

And i Write <a href="productdetail.php?prodid=<?=$row_prod['product_id']?>"> On all Product Links

 

And I wrote

 

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

RewriteBase /

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

 

on my.htaccess file

I also Try this but IT Can't Happened

 

You Can See it in http://www.grabkart.com/index1.php

 

Here is my .htaccess file

 

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

RewriteBase /

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

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.