ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

htaccess problem 301 redirect

February 04, 2009 9:34am

Subscribe [1]
  • #1 / Feb 04, 2009 9:34am

    orezz

    43 posts

    A website I made originally had the index.php in the url. It now has to be removed which is no problem, but the site is already indexed by google and we need to put 301 redirects from the urls with index.php to the urls without index.php.

    The following code is in the .htaccess file:

    RewriteEngine on
    RewriteRule ^index.php/(.*) <a href="http://www.mysite.com/$1">http://www.mysite.com/$1</a> [R=301,L]
    RewriteCond $1 !^(eerstegesprekgratis|images|member_photos|js|system|themes|uploaded|index\.php|admin\.php) [NC]
    RewriteRule ^(.*)$ /index.php/$1 [L]

    Without this rule: RewriteRule ^index.php/(.*) http://www.mysite.com/$1 [R=301,L], the website is working perfect, but visitors can visite http://www.mysite.com/articles/article/ and also http://www.mysite.com/index.php/articles/article/. When I add the above rewriterule the visitor gets redirect the right way, but on the redirected page I get an infinit loop error from firefox.

    Can someone help on this one?

  • #2 / Feb 05, 2009 5:00am

    orezz

    43 posts

    Someone knows what is wrong with my .htaccess settings?
    It’s quit urgent ..

  • #3 / Feb 06, 2009 3:48am

    orezz

    43 posts

    Anyone has a clue how we can solve this problem? It can’t be that hard right?

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases