0

Hi Guyz,
Am facing an issue that $_GET[] not working in my Mod_Rewrite,
My Odd URL is :
http://groupon.ig-demo.com/index.php?id=12&dealname=Oil%20Treatment

My Friendly URL is :
http://groupon.ig-demo.com/id/12/Oil%20Treatment.htm

And My HTACCESS is :

Options +FollowSymlinks
DirectoryIndex index.php
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?/$1 [L]

RewriteRule ^id/([^/])/([^/]).htm$ /index.php?id=$1&dealname=$2 [QSA,L]

When i try this all are working fine but $_GET["id"] and $_GET["deal_name"] is not working for me,
$_GET[] attribute is not working,
Any help much appreciated!

Thank You.

4
Contributors
4
Replies
12
Views
4 Years
Discussion Span
Last Post by diafol
3

@mohamedasif18

Am facing an issue that $_GET[] not working in my Mod_Rewrite,

You can try this, it's not tested:

RewriteRule ^.*/id/$/index.php?id=12[QSA,L]
RewriteRule ^.*/id/([a-zA-Z0-9_]+)/([a-zA-z0-9_]+)$/index.php?id=12[QSA,L]

Edited by LastMitch: grammer

0

I think you are just missing the plus signs:

RewriteRule ^id/([^/]+)/([^/]+)\.htm$ /index.php?id=$1&dealname=$2 [QSA,L]
0

Sorry Guys.. Ist not working. I have tried your both. URL's are working fine but $_GET[] is not working.. Is there any way for it??

1

Try:

RewriteEngine On
RewriteRule ^id/([^/]*)/([^/]*)\.htm$ /index.php?id=$1&dealname=$2 [L]
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.