how to 301 redirect index.php to the domain root?

Hi,

 

Does anyone know how to 301 redirect Dolphin's index.php to "/"?

 

I want to avoid having two versions of my home page indexed by Google as it splits page authority, but I'm not having any luck using the usual rewrite rules I use in my wordpress sites.

 

Help would be greatly appreciated.  Thanks in advance.

Quote · 24 Mar 2013

One of the great minds here must know how.  The code I'm trying to use in .htaccess to achieve this is:

 

Options +FollowSymLinks
DirectoryIndex index.php
 
RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.php HTTP/
RewriteRule ^index.php$ http://mysite.com/ [R=301,L]
 
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

 

The result of adding the above to .htaccess is a 500 server error.  Does anyone have a solution for this?

Quote · 25 Mar 2013

I would have to double check, but I have used something like this a long time ago:

RewriteEngine On
RewriteCond %{THE_REQUEST} ^.*/index.php
RewriteRule ^(.*)index.php$ http://www.yoursite.com/$1 [R=301,L]


One thing you may have a problem with when redirecting index.php to yoursite.com are with links on the homepage like: Latest, Top, etc. in photos, video, etc. block areas.

Many of those links resemble:
http://demo.boonex.com/index.php?bx_photos_mode=last...

So if someone where to click on latest, top, etc. it will probably try to redirect that area of the block to yoursite.com since the link does contain index.php in it and you will end up with some not so pretty results.

Like I said I haven't tried doing this in quite a while though.

DialMe.com - Your One and Only Source For Boonex Dolphin Tutorials and Resources
Quote · 25 Mar 2013

i use this:

RewriteEngine On


RewriteCond %{THE_REQUEST} ^[A-Z]{3,9} /index.php HTTP/
RewriteRule ^index.php$ http://www.your-domain.com/ [R=301,L]

ue30 Mods - http://www.boonex.com/market/posts/ue30
Quote · 25 Mar 2013

Cheers, gents.  That works now. 

 

@gameutopia - From what I can tell Dolphin doesn't use links in that format in 7.1.  I'm new so I have no idea how it used to be, but for example, Top photos now link like http://yoursite.com/m/photos/browse/top etc. so I'm assuming that's not going to be an issue with the current version. 

 

Edit: On second thoughts, it probably has more to do with the permalinks structure than the Dolphin version.

2nd Edit: Actually, I see the links that I think you're referring to and they're not actually to the root dir, they're to /modules/ like this: http://yoursite.com/modules/index.php?bx_photos_mode=top&r=photos%2Fhome%2F&status=approved&ownerStatus=Array&albumType=bx_photos&page={page}&per_page={per_page}

 

If it were an issue I might have to do it the other way and make all links to root 301 to index.php so there's only one version.  But I would loath to need to resort to that.

 

Thanks again or your help.

Quote · 25 Mar 2013

Okay, so after testing it turns out that it does actually break the links at /modules/index.php?

 

 

 

Would someone please chime-in on how this can be fixed?

 

Quote · 25 Mar 2013

It seems there's actually a very simple solution to avoid splitting the page authority of your homepage:  Just go into Menu Builder and replace "index.php" with the full website URL.

 

I wonder why the navbar doesn't link this way by default?

 

/sigh... I hate learning the quirks of new scripts lol

Quote · 25 Mar 2013
 
 
Below is the legacy version of the Boonex site, maintained for Dolphin.Pro 7.x support.
The new Dolphin solution is powered by UNA Community Management System.