3

I want to Rewrite my GET Query String from this -

http://www.example.com/verify.php?key=547b52f2b5d20d258e62de1e27b55c

to this

http://www.example.com/verify/547b52f2b5d20d258e62de1e27b55c

I am using the following rule but it does not seem to work -

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^(([A-Za-z0-9\-]+/)*[A-Za-z0-9\-]+)?$ $1.php

RewriteRule    ^[A-Za-z-]+/([A-Za-z0-9-]+)/?$    verify.php?key=$1    [NC,L]
hjpotter92
  • 78,589
  • 36
  • 144
  • 183

1 Answers1

1

Use the following:

RewriteEngine On
RewriteCond %{THE_REQUEST} ^GET\ /verify\.php\?key=([^\s&]+) [NC]
RewriteRule ^verify\.php$ /verify/%1? [R=301,L]

RewriteRule ^verify/([^/]+)/?$ /verify.php?key=$1 [NC,L]
hjpotter92
  • 78,589
  • 36
  • 144
  • 183