Webmasters Stack Exchange is a question and answer site for pro webmasters. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I moved my website to a new CMS and some of my URLs look different now, so I want to delete a part of incoming URLs so that links to my page still work properly.

The old URL looks like:

www.example.com/MY-FORUM/my-forum/category/postingtitle

I want to get rid of the MY-FORUM, so it looks like:

www.my-site.de/my-forum/category/postingtitle

After reading through different posts I tried the following:

RewriteRule ^MY-FORUM/(.*) /$1 [R=301,L]

Which gives me back an error message stating:

Infinite loop detected in JError

(I´m using joomla)

What is causing this?

share|improve this question

migrated from serverfault.com Nov 6 '11 at 23:46

This question came from our site for system and network administrators.

I guess you are defining it in the <VirtualHost>, so the pattern must have a leading slash:

RewriteRule ^/MY-FORUM/(.*) /$1 [R=301,L]
share|improve this answer
    
Although if the original rule didn't match then presumably the OP wouldn't be getting an "infinite loop". – w3dk Oct 31 '15 at 21:11

The fact that you are getting a Joomla error would suggest that you are already getting past mod_rewrite. By itself, the above directive should not generate a redirect loop - assuming you don't have URLs that start /MY-FORUM/MY-FORUM/?

However, Joomla itself uses mod_rewrite, so it's possible there is a conflict with other directives. Since this is an external redirect it should come near the start of your script, after the RewriteEngine On directive and before any of Joomla's internal rewrites.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.