htaccess rewrite
-
Im having trouble trying to rewrite a url in my htaccess
The url is http://www.example.com/bodega/gallery/album/nightlife
and on the server side i would it like to read
http://www.example.com/bodega/gallery?album=nightlifeThe problem is if i use the below code it works but adds the query string to the url which i dont want it to do
RewriteRule ^gallery/([^/]+)/([^/]+) http://www.example.com/bodega/gallery?album=$2 [L]If i use this code without http://www.example.com it brings me to a 404
RewriteRule ^gallery/([^/]+)/([^/]+)$ /bodega/gallery?album=$2 [L]Here is the full htaccess file `
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^gallery/([^/]+)/([^/]+) http://www.example.com/bodega/gallery?album=$2 [L]
#RewriteRule ^gallery/([^/]+)/([^/]+)$ /bodega/gallery?album=$2 [L]
RewriteRule ^login$ http://example.com/bodega/wp-login.php [NC,L]
RewriteRule ^admin$ http://example.com/bodega/wp-admin/index.php [NC,L]
RewriteBase /bodega/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /bodega/index.php [L]
</IfModule>
# END WordPress
`Any help would be grateful
The topic ‘htaccess rewrite’ is closed to new replies.