Internal server error using htaccess-redirect

I have a .htaccess in my WP-Blog and want to redirect e.g.

http://blog.clever4ever.at/?feed=rss2&cat=6

Read More

to

http://blog.clever4ever.at/?cat=6

My script:

Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} ^feed=rss2&cat=([^&]+) [NC]
RewriteRule /?$ /?cat=%1 [L,R=301]

Unfortunately i get an internal server error, and don’t know why… Can someone help?

Related posts

Leave a Reply

2 comments

  1. It is not working due to a mistake in your regex where you have used this regex:

     /?$
    

    which will match each and every URL every time and will cause looping (and will cause internal server error).

    You probably meant this:

    Options +FollowSymLinks -MultiViews
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^feed=rss2&(cat=[^&]+) [NC]
    RewriteRule ^/?$ /?%1 [L,R=301]
    
  2. Try changing it to

    Options +FollowSymLinks -MultiViews
    RewriteEngine On
    RewriteBase /
    RewriteCond %{QUERY_STRING} ^feed=rss2&cat=([^&]+) [NC]
    RewriteRule ^ /?cat=%1 [L,R=301]
    

    I replaced /?$ with ^