Zuker
Zuker

Reputation: 456

URL rewrite not found

My URL it's like this

http://domain.com/validar/api.php?desde=email&[email protected]

and i want to rewrite url's like this

http://domain.com/validar/email/[email protected]/

I thought this was the way

RewriteEngine On
RewriteBase /validar/
RewriteRule ^/([^/]*)/([^/]*)/$/api.php?desde=$1&que=$2 [L]

But i'm getting 404 and cant make it work

Any ideas? Thanks

Upvotes: 1

Views: 106

Answers (1)

anubhava
anubhava

Reputation: 785128

Remove leading / from your rule and don't get why you have mail/ in your target URI since it is not shown in your question.

Try:

RewriteEngine On
RewriteBase /validar/

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/([^/]+)/?$ api.php?desde=$1&que=$2 [L,QSA]

Upvotes: 2

Related Questions