This is currently my htacess file:
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([\w\d]+)$ /negocio/?id=$1 [L]
ErrorDocument 404 http://www.lujanventas.com/404.php
RewriteOptions Inherit
When the first directly is not found it passes it as a variable. But loses the rest of the URL. I want to retain all the rest of the URL except the first part, so that:
http://www.lujanventas.com/something/info/?var=1
Becomes:
http://www.lujanventas.com/negocio/info/?id=something&var=1
You need to append the
[QSA]flag (querystring append) to preserve the existing query string.Update:
If you have multi-directory patterns to match like
something/info, you’ll need/following the matched character class, and remove the$.