Shadow_boi
Shadow_boi

Reputation: 2198

htaccess 301 redirect rule

I want to

redirect http://www.mysite.com/index.php?option=com_content&view=frontpage&Itemid=1

TO

http://www.mysite.com/

Can you please show me the 301 redirect rule for htaccess?

Thanks.

I tried the following, but no luck.

RewriteCond %{QUERY_STRING} ^option=com_content&view=frontpage&Itemid=1$
RewriteRule ^/index.php$ http://www.mysite.com [L,R=301] 

Upvotes: 1

Views: 421

Answers (2)

Love Sharma
Love Sharma

Reputation: 1999

You can try below configuration,

RewriteCond %{QUERY_STRING} option=com_content&view=frontpage&Itemid=1
RewriteRule index\.php$ /? [L,R=301]

I tried it on my domain and it works fine. Hope this works for you too... :)

Upvotes: 3

David Grayson
David Grayson

Reputation: 87386

According to www.htaccessredirect.net, the code to do this would be:

Redirect 301 /index.php?option=com_content&view=frontpage&Itemid=1 /

Alternatively, you could look in to using apache's mod_rewrite module.

Upvotes: 0

Related Questions