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]
2
  • 1
    verify?=keybf3 is the URL actually like that? Commented Dec 1, 2015 at 6:10
  • @hjpotter92 - Edited my question. Please check. Commented Dec 1, 2015 at 6:13

1 Answer 1

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]
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.