lisovaccaro
lisovaccaro

Reputation: 33956

.htaccess rewrite rule redirecting instead of rewriting url?

This is the content of my .htaccess file:

RewriteEngine On
RewriteBase /

RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([^/]+)(/.+)? /negocio$2?shopURL=$1 [L,QSA]

RewriteOptions Inherit

It takes not found directories and transform them into a php variable while retaining the rest of the url. When I go to:

http://lujanventas.com/test/asdf

The address bar shows:

http://lujanventas.com/negocio/?shopURL=asdf

(It should still show: "http://lujanventas.com/test/asdf")

What am doing wrong?

Upvotes: 1

Views: 1598

Answers (1)

lisovaccaro
lisovaccaro

Reputation: 33956

Fixed it by adding a / after the 2.

RewriteRule ^([^/]+)(/.+)? /negocio$2/?shopURL=$1 [L,QSA]

Upvotes: 1

Related Questions