curiouslychris
curiouslychris

Reputation: 887

Redirect Joomla core pages via .htaccess

I'm having trouble redirecting Joomla's core pages via .htaccess; for instance, I need

/component/users/?view=login

to redirect to another page, but the server seems to ignore the redirect entirely. Is there something I'm missing here? Currently, I'm trying to use:

Redirect /component/users/?view=login http://www.example.com/

Upvotes: 1

Views: 1172

Answers (1)

Jon Lin
Jon Lin

Reputation: 143846

You can't match against the query string in a Redirect, you need to use the %{QUERY_STRING} variable and mod_rewrite. Above any other rules you may already have in the htaccess file in your document root, add:

RewriteEngine On
RewriteCond %{QUERY_STRING} (^|&)view=login(&|$)
RewriteRule ^component/users/$ http://www.example.com/? [L,R]

Upvotes: 1

Related Questions