0

The current .htaccess not working :

RewriteRule ^search\.cfm?q=(.*)$ index.php?current=search&q=$1 [NC,L]

current syntax is:

index.php?current=search&q=stackoverflow

New syntax :

search.cfm?q=stackoverflow
Tomasz Kowalczyk
  • 10,472
  • 6
  • 52
  • 68
Anass
  • 2,101
  • 2
  • 15
  • 20
  • 2
    Possible duplicate of [URL rewriting with PHP](http://stackoverflow.com/questions/16388959/url-rewriting-with-php) – Tomasz Kowalczyk Feb 14 '16 at 20:51
  • 1
    Possible duplicate of [How to change the PHP file extension using .htacess file on GoDaddy Linux Hosting?](http://stackoverflow.com/questions/7897353/how-to-change-the-php-file-extension-using-htacess-file-on-godaddy-linux-hostin) – jostrander Feb 14 '16 at 20:59
  • i want this result : search.cfm?q=stackoverflow – Anass Feb 14 '16 at 21:15

1 Answers1

1

Based on what you asked for, this should be what you need.

RewriteRule ^search\.cfm$ index.php?current=search [NC,L,QSA]

The QSA tag is going to append the q= Query String back to your .php file.

jostrander
  • 745
  • 5
  • 18