1

When i click on a link it should redirect to for ex; www.domain.com/demo/item.php?item=abc&id=3 but in url it should show as www.domain.com/demo/abc/3

im Using

<IfModule mod_rewrite.c>
Options +SymlinksIfOwnerMatches
RewriteEngine on
RewriteRule ^demo/(.+) demo/item.php?item=$1&id=$2 [NC,L]

Please help

2 Answers2

0

You can try with this one, it will not redirect your URL but if you execute your URL (www.domain.com/demo/abc/3) it will be work.

Options +FollowSymLinks
RewriteEngine on
RewriteRule ^demo/([0-9a-zA-Z\s_]+)/([0-9]+)(/?)$ demo/item.php?item=$1&id=$2 [NC,L]
Mukesh Jakhar
  • 309
  • 2
  • 7
0

You could try like this after adding the rewritebase directive

RewriteEngine on
RewriteBase /

RewriteRule ^demo/([0-9a-zA-Z\s_]+)/([0-9]+)(/?)$ demo/item.php?item=$1&id=$2 [NC,L]
Professor Abronsius
  • 33,063
  • 5
  • 32
  • 46