Forum Moderators: phranque

Message Too Old, No Replies

301 Redirect goes into a loop

         

ron15

8:47 am on Jul 11, 2010 (gmt 0)

10+ Year Member



I'm attempting to do a 301 redirect on a Drupal site of mine, that is running the Global Redirect module for clean URL's, etc. The old page does not have a page extension, the new page does. I did the following in my .htaccess file.

Redirect 301 /olddir/page htp://www.mysite.com/newdir/page.html

(http changed to htp)

It seems to go into a loop. Firefox reports "the page is not redirecting properly". The Apache log shows many iterations of below.

/newdir/page.htmlpage.htmlpage.htmlpage.htmlpage.htmlpage.html?q=newdir/page.html

Do I need to perform the redirect in a different manner given its a dynamic Drupal site? I've done this type of redirect for my static sites, and Wordpress also if I'm not mistaken.

phranque

11:14 am on Jul 11, 2010 (gmt 0)

WebmasterWorld Administrator 10+ Year Member Top Contributors Of The Month



you could be getting additional external redirects and/or internal rewrites from mod_rewrite or mod_alias directives in either a .htaccess or apache config file.
in addition, the drupal script itself could be providing 301 or 302 responses which would cause a redirect.

Oimachi2

10:14 am on Jul 29, 2010 (gmt 0)

10+ Year Member Top Contributors Of The Month



Try this in your .htaccess it works with Joomla and even plain HTML

Options +FollowSymlinks
RewriteEngine on
rewritecond %{http_host} ^yoursite.com [nc]
rewriterule ^(.*)$ [yoursite.com...] [r=301,nc]