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.

Recommended Answers

All 4 Replies

Member Avatar for LastMitch

@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]

I think you are just missing the plus signs:

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

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??

Member Avatar for diafol

Try:

RewriteEngine On
RewriteRule ^id/([^/]*)/([^/]*)\.htm$ /index.php?id=$1&dealname=$2 [L]
Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.