Redirect /index.php permanently?

Discuss Search Engine Optimization in relation to Joomla!. This forum will also have discussions on SEF/SEO Joomla! extensions.

Moderator: General Support Moderators

Knalltrauma
Joomla! Intern
Joomla! Intern
Posts: 55
Joined: Sun Sep 18, 2005 8:00 pm

Redirect /index.php permanently?

Post by Knalltrauma » Mon Aug 24, 2009 2:05 pm

Hello everyone

I'd like to redirect the regular www.mysite.com/index.php permanently to www.mysite.com. The reason why to do this is, that e.g. the GoogleBot doesn't index both pages.

Does anybody knows, how to redirect it with a permanent 301?

Kind regards
:D

User avatar
kavaXtreme
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Tue Dec 13, 2005 9:56 pm
Location: Oregon
Contact:

Re: Redirect /index.php permanently?

Post by kavaXtreme » Sat Aug 29, 2009 12:14 am

I'm looking for an elegant solution for this too (and /home and /home.html too). Anyone?
- Bible Yellow Pages: http://www.bibleyp.com

djohnson1215
Joomla! Explorer
Joomla! Explorer
Posts: 370
Joined: Fri Jun 13, 2008 7:49 pm
Location: Escondido, CA 92026
Contact:

Re: Redirect /index.php permanently?

Post by djohnson1215 » Tue Sep 01, 2009 3:49 pm

Hello Knalltrauma,

First, Google knows about both http://www.mysite.com/index.php and http://www.mysite.com. It is likely that Google has already canonicalized these URLs. In other words, Google has found that these two URLs are identical. They know this because either the hash values for each page are the same or Google's "near dup conotent" check has determined that these pages are the same. From Google's point of view, these two URLs are aliases of one another.

Here is how you can test. Put one URL into Google search query and see the results. Now put the other URL into Google search query and see the results. If Google has canonicalized these URLs, you will see only one URL reported by Google. Google usually picks the URL that has the highest PR value.

The 301 permanent redirect helps the search engines figure this out. 301 redirects are applied at the host server level, not at the Joomla level. Therefore, you must log into your hosting control panel and look around for the redirect options. Be sure to use a 301 redirect and not a 302 redirect. Some control panels do not make this clear. So be careful. If you have questions, contact your hosting company for directions.

Once the redirect is in place, check your redirect through an HTTP header check tool: try http://www.rexswain.com/httpview.html. The report will show you whether a redirect is in place and what it is (301 or 302, etc.).

Hope this helps,
dgj
D. Johnson
Technology is our advantage;
performance our passion

http://www.positionresearch.com

gobeyond
Joomla! Apprentice
Joomla! Apprentice
Posts: 23
Joined: Sat May 05, 2007 6:33 pm
Location: Minneapolis, St Paul, MN
Contact:

Re: Redirect /index.php permanently?

Post by gobeyond » Tue Sep 01, 2009 7:10 pm

This can be done rather easily. If you do a google search, there are several sites that provide instruction on this. You need to add some rewrite codes in the .htaccess file and that is all you need.

Search engines consider index.php, index.html, or index.htm as home page. They won't consider your domain name and domain name/index.xxx two separate pages.
http://www.SiteRevamp.com - SEO Service Minneapolis St Paul, MN

djohnson1215
Joomla! Explorer
Joomla! Explorer
Posts: 370
Joined: Fri Jun 13, 2008 7:49 pm
Location: Escondido, CA 92026
Contact:

Re: Redirect /index.php permanently?

Post by djohnson1215 » Tue Sep 01, 2009 8:23 pm

I stand (or rather sit) corrected. gobeyond is right. An .htaccess file is an extension of the server settings.

Learned something new today.
:-)
dgj
D. Johnson
Technology is our advantage;
performance our passion

http://www.positionresearch.com

User avatar
kavaXtreme
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Tue Dec 13, 2005 9:56 pm
Location: Oregon
Contact:

Re: Redirect /index.php permanently?

Post by kavaXtreme » Wed Sep 02, 2009 12:02 am

Actually, I have to disagree with gobeyond on this one. For one of my sites, Google Webmaster is showing an incoming link as coming from four different pages: /, index.php, com_frontpage, and https. Three of these pages have different PR values, even though the content is identical. So not only is Google seeing them as different pages, but the PR is being diluted.

And I just saw the same issue on another site I maintain with index.php and /home showing as different pages. It's quite possible that in all of these cases other sites have linked to the individual variations, and that's how Google finds them. But the point that only one home page should be available to link to in the first place still stands.

sh404 resolves some of these issues, but not all. What surprises me is that I can't find a plugin to resolve this for simple sites that only need Joomla SEF. I'm hoping someone else knows of a solution like that which I've missed (or can post the relevant lines to add to htaccess, though those always seem to require more effort to maintain).
- Bible Yellow Pages: http://www.bibleyp.com

User avatar
kavaXtreme
Joomla! Intern
Joomla! Intern
Posts: 74
Joined: Tue Dec 13, 2005 9:56 pm
Location: Oregon
Contact:

Re: Redirect /index.php permanently?

Post by kavaXtreme » Wed Sep 02, 2009 12:02 am

- Bible Yellow Pages: http://www.bibleyp.com

djohnson1215
Joomla! Explorer
Joomla! Explorer
Posts: 370
Joined: Fri Jun 13, 2008 7:49 pm
Location: Escondido, CA 92026
Contact:

Re: Redirect /index.php permanently?

Post by djohnson1215 » Wed Sep 02, 2009 12:42 am

kavaXtreme,

I feel your pain. In practice, all these URL examples (below) are distinctly different "logical" pages (even though they are the same "physical" page) in the world of http.

http://www.domain.com
http://www.domain.com/index.html
domain.com
domain.com/index.html

You could add https and get a few more variations of the same "physical" page.

This is the nightmare story for search engines. Theoretically, each of these URLs have the same hash value. And with the same hash value, search engines should be able to tell that they are aliases of each other.

Now - the problem. Lets say Google crawls and knows about each of these URLs. But the webmaster changes something. Google crawls one of the URLs and sees that the hash value has changed. Now one of the URLs has a mismatch to the other URL hash values. What does Google do? Do they spider the other URLs to see if they too have change hash values? I guess not (too many cpu cycles). And what happens if the webmaster makes another change before Google has time to check the other URLs? It's a problem. Does Google's Db go out of sync? May be.

The problem is the http protocol that allows one single "physical" page to be referenced different ways, by multiple URLs. It is a mess.

So SEO best practices are to help the search engines figure this out by applying 301 redirects to one of the URLs. The 301 redirect appears in the http header info. So Google and other SEs can understand that they need not waist their time (and cpu cycles) on a page that could be an alias of another.

So when you see lots of URLs of the same page in Google's webmaster account, Google is confused. They will ultimately sort it out, but in the mean time, they don't know where to assign the PR and which URL to rank. YUCK!

This story gets even deeper when you start to consider Google's Near-Duplication Content algo. But that discussion is for another day.

The moral of this story is: "Don't give the SE's a chance to get confused".

Google is going through a huge back-end update called "Caffeine". It is very possible that Google has some data synchro issues that take time to work through. If you have not put 301 redirect on 3 of the 4 URLs, do it. Then just wait for the "Google Love" to come your way. :-)

Hope this helped.
D. Johnson
Technology is our advantage;
performance our passion

http://www.positionresearch.com

a2purn
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Fri Feb 27, 2009 9:27 am
Contact:

Re: Redirect /index.php permanently?

Post by a2purn » Sat Oct 10, 2009 2:18 am

The 301 permanent redirect helps the search engines figure this out. 301 redirects are applied at the host server level, not at the Joomla level. Therefore, you must log into your hosting control panel and look around for the redirect options. Be sure to use a 301 redirect and not a 302 redirect. Some control panels do not make this clear. So be careful. If you have questions, contact your hosting company for directions.
Thank for the info,
So, should we have to use a 301 also for https? currently we are using 302 by install redirect plugin after checked by above link checker i am using 302 redirect. and in the google toolbar shows 0 PR. is there any difference using https and without http.

Thanks. :o

hostmaster
Joomla! Apprentice
Joomla! Apprentice
Posts: 10
Joined: Sat Oct 10, 2009 6:39 am

Re: Redirect /index.php permanently?

Post by hostmaster » Sat Oct 10, 2009 7:25 am

Knalltrauma wrote:Hello everyone

I'd like to redirect the regular www.mysite.com/index.php permanently to www.mysite.com. The reason why to do this is, that e.g. the GoogleBot doesn't index both pages.

Does anybody knows, how to redirect it with a permanent 301?

Kind regards
:D
Both URL will be treated as different and can cause duplicate content issue, thus it is better to redirect 302.
http://www.rankrobbers.com - Affordable SEO Company India

djohnson1215
Joomla! Explorer
Joomla! Explorer
Posts: 370
Joined: Fri Jun 13, 2008 7:49 pm
Location: Escondido, CA 92026
Contact:

Re: Redirect /index.php permanently?

Post by djohnson1215 » Mon Oct 12, 2009 3:25 pm

hostmaster,

302 redirects are temporary redirects
301 redirects are permanent redirects

Google and webmasters alike recommend 301 redirects if you want the spiders to obey the redirect. Spiders will not obey a 302 redirect. It is 302 redirects that can cause dup content issues. 301 redirects will not.

This all assumes that the search engines do not figure out that www.mysite.com/index.php and www.mysite.com are aliases of one another. If they figure out that one is the alias of the other, then a 301 is just added protection against duplicate content and PR split issues.
D. Johnson
Technology is our advantage;
performance our passion

http://www.positionresearch.com

djohnson1215
Joomla! Explorer
Joomla! Explorer
Posts: 370
Joined: Fri Jun 13, 2008 7:49 pm
Location: Escondido, CA 92026
Contact:

Re: Redirect /index.php permanently?

Post by djohnson1215 » Mon Oct 12, 2009 3:31 pm

a2purn,

I am not sure why you have https. Https is used for secure areas of your website. Typically, but not always, https is associated with an SSL key.

So, https should be separate from http portions of your website. In this case, you should NOT 301 redirect https with SSL keys to http pages.

BUT, it you have links from https pages to http pages, you should consider absolute addressing those links so they do not resolve to https pages. However, in the rare case that you can not absolute address http links on https pages, then use a 301 redirect to "break out" of the https scheme and back to http pages.

Hope this makes sense.
D. Johnson
Technology is our advantage;
performance our passion

http://www.positionresearch.com

a2purn
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Fri Feb 27, 2009 9:27 am
Contact:

Re: Redirect /index.php permanently?

Post by a2purn » Mon Oct 12, 2009 3:59 pm

Thanks for your reply,
Actually i want the https is used for our separate pages only but why all our pages redirect to https, so now i break using https and use 301 redirect to http. i am affraid i have duplicate content by google.
should we have to remove redirect 301 https to http?
and how about bots will index again https if i remove it, since https for human only and http for robots,
would you please explain about robots no index https but http

Thank you

djohnson1215
Joomla! Explorer
Joomla! Explorer
Posts: 370
Joined: Fri Jun 13, 2008 7:49 pm
Location: Escondido, CA 92026
Contact:

Re: Redirect /index.php permanently?

Post by djohnson1215 » Mon Oct 12, 2009 8:18 pm

a2purn,

When you have an https page, and if links on that page have a relative address, then the linked pages will become https. For this reason, you should either:

1) use absolute address in your links on https pages (eg. http://www.domain.com/path/), or
2) 301 redirect the pages you want to be http from https pages.

Also, note that Joomla allows you to set each Joomla menu item to SSL enabled Off/Ignore/On. Select this option from Parameters (System). If you set to Off, a Joomla menu item on an https page should resolve to a http page (I think this is right). You may want to try this Joomla feature for Joomla menu items. If it works the way I think it works, then you will not need to 301 redirect Joomla menu item lined pages.
D. Johnson
Technology is our advantage;
performance our passion

http://www.positionresearch.com

a2purn
Joomla! Intern
Joomla! Intern
Posts: 90
Joined: Fri Feb 27, 2009 9:27 am
Contact:

Re: Redirect /index.php permanently?

Post by a2purn » Mon Oct 12, 2009 8:32 pm

@djohnson1215

Thank you very much for your reply.
I can find it and running well from each menu that i want to set to https so that i have not to use redirect all pages to https.
once again thank you very much. :D

User avatar
CAD_designer
Joomla! Fledgling
Joomla! Fledgling
Posts: 1
Joined: Mon Nov 30, 2009 12:21 pm
Contact:

Re: Redirect /index.php permanently?

Post by CAD_designer » Mon Nov 30, 2009 12:37 pm

Just to add my experiences;

In order to redirect /home and /index to the root and return all non www addresses to www, I added the following to my .htaccess in the root of the /public folder;

Options +FollowSymLinks
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\."yoursite"\.co\.uk
RewriteRule (.*) http://www.yoursite.co.uk/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^.*/index\.php
RewriteRule ^(.*)index.php$ http://www.. [R=301,L]

a quick redirect check (i used searchmasters) shows redirects are working. However, i could not log in to the Joomla "back end" admin page. This was due to the code converting all urls to root. The admin page uses /administrator/index.php as a login url, therefore, the login page was returning blank.
A quick fix of this was to add the following exception to the code;
RewriteCond %{REQUEST_URI} !^/administrator

I now have a working (more) SEF friendly site, and can login as admin!
Hope this helps

Hoegaarden
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Jan 21, 2010 4:36 pm

Re: Redirect /index.php permanently?

Post by Hoegaarden » Thu Jan 21, 2010 4:50 pm

Thanks for that CAD_designer :)

I was having the same problem with the administrator section and couldn't figure out why until i traced my steps back to the index file redirect. I've implemented this it works fine.

However, i now have a problem because the site that I am working on has a search function and now the redirect has stopped this from working. When I removed the redirect though to see the URL of the search results, it doesn't have index.php in there. This has baffled me. :(

Anyone have any ideas?

misholini
Joomla! Apprentice
Joomla! Apprentice
Posts: 17
Joined: Wed Mar 10, 2010 1:00 am

Re: Redirect /index.php permanently?

Post by misholini » Wed Mar 10, 2010 1:03 am

I have experienced the same problem- the redirect causes the search module to fail

hexagonsales
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Wed Oct 22, 2008 7:44 pm

Re: Redirect /index.php permanently?

Post by hexagonsales » Wed Mar 10, 2010 3:53 pm

Found this code, added it to .htaccess:

RewriteEngine On
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.yoursite.co.uk/ [R=301,L]

worked straight away for me without any issues!

User avatar
eok
Joomla! Intern
Joomla! Intern
Posts: 57
Joined: Sat Feb 27, 2010 4:20 am

Re: Redirect /index.php permanently?

Post by eok » Thu Mar 11, 2010 1:13 am

my index.php doesnt want to dissapear, if I turn on mod_rewrite I have got Page not found.

maybe smth wrong inside .htaccess

#
# mod_rewrite in use

RewriteEngine On

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule (.*) index.php
#
########## End - Rewrite rules to block out some common exploits

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)




RewriteBase /


########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section
Signature rules: Literal URLs only - http://forum.joomla.org/viewtopic.php?f=8&t=65

hexagonsales
Joomla! Intern
Joomla! Intern
Posts: 72
Joined: Wed Oct 22, 2008 7:44 pm

Re: Redirect /index.php permanently?

Post by hexagonsales » Thu Mar 11, 2010 9:07 am

Below you will see a copy of mine. Have a look and see if there are any major differences:

##
# @version $Id: htaccess.txt 13415 2009-11-03 15:53:25Z ian $
# @package Joomla
# @copyright Copyright (C) 2005 - 2008 Open Source Matters. All rights reserved.
# @license http://www.gnu.org/copyleft/gpl.html GNU/GPL
# Joomla! is Free Software
##

#####################################################
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE
#
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations. It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file. If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's. If they work,
# it has been set by your server administrator and you do not need it set here.
#
#####################################################

## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine on
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.hexagon-propertymanagement.co.uk/ [R=301,L]
Rewritecond %{http_host} ^hexagon-propertymanagement.co.uk [nc]
Rewriterule ^(.*)$ http://www.hexagon-propertymanagement.co.uk/$1 [r=301,nc]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /home\ HTTP/
RewriteRule ^index\.php$ http://www.hexagon-propertymanagement.co.uk/ [R=301,L]

########## Begin - Rewrite rules to block out some common exploits
## If you experience problems on your site block out the operations listed below
## This attempts to block the most common type of exploit `attempts` to Joomla!
#
## Deny access to extension xml files (uncomment out to activate)
#<Files ~ "\.xml$">
#Order allow,deny
#Deny from all
#Satisfy all
#</Files>
## End of deny access to extension xml files
RewriteCond %{QUERY_STRING} mosConfig_[a-zA-Z_]{1,21}(=|\%3D) [OR]
# Block out any script trying to base64_encode crap to send via URL
RewriteCond %{QUERY_STRING} base64_encode.*\(.*\) [OR]
# Block out any script that includes a <script> tag in URL
RewriteCond %{QUERY_STRING} (\<|%3C).*script.*(\>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL
RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL
RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Send all blocked request to homepage with 403 Forbidden error!
RewriteRule ^(.*)$ index.php [F,L]
#
########## End - Rewrite rules to block out some common exploits

# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root)

# RewriteBase /

########## Begin - Joomla! core SEF Section
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/index.php
RewriteCond %{REQUEST_URI} (/|\.php|\.html|\.htm|\.feed|\.pdf|\.raw|/[^.]*)$ [NC]
RewriteRule (.*) index.php
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
########## End - Joomla! core SEF Section

Hoegaarden
Joomla! Apprentice
Joomla! Apprentice
Posts: 9
Joined: Thu Jan 21, 2010 4:36 pm

Re: Redirect /index.php permanently?

Post by Hoegaarden » Thu Mar 11, 2010 5:18 pm

Thanks for this. What i actually fixed this but can't remember how. Will go over the site again and post the solution on here.

User avatar
gabrieluk
Joomla! Apprentice
Joomla! Apprentice
Posts: 18
Joined: Sat May 09, 2009 8:25 pm

Re: Redirect /index.php permanently?

Post by gabrieluk » Thu Apr 01, 2010 11:09 pm

Hi,
I'm having the same issue:
"Redirect /index.php permanently?"
As this topic is a big issue,and this post has gone wild with variations(https,etc...)I would like a final confirmation of the best practise to have only one homepage:www.mysite.com indexed by Google.
In my case, SEF is on,and i have:
http://www.mysite.com
http://www.mysite.com/index.php
http://www.mysite.com/home.html
So the best would be:

### re-direct home.html to root / ###
RewriteCond %{THE_REQUEST} ^.*\/home\.html\ HTTP/
RewriteRule ^(.*)home\.html$ /$1 [R=301,L]

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]
Last edited by Leftfield on Fri Apr 02, 2010 3:03 am, edited 1 time in total.
Reason: Mod Edit: Please use small letters and read forum rules.

Davidq
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Feb 28, 2008 5:55 pm

Re: Redirect /index.php permanently?

Post by Davidq » Thu Apr 08, 2010 7:07 am

I am also having a problem derirecting I managed to do the site.com to www.site.com however icant get the index.php to work i ahve tried all of the above and it wont load the site I am hosting on godaddy
## Can be commented out if causes errors, see notes above.
Options +FollowSymLinks

#
# mod_rewrite in use

RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\."site"\.co\.za
RewriteRule (.*) http://www.site.co.za/$1 [R=301,L]
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.site.co.za/ [R=301,L]
RewriteCond %{REQUEST_URI} !^/administrator

Davidq
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Feb 28, 2008 5:55 pm

Re: Redirect /index.php permanently?

Post by Davidq » Thu Apr 08, 2010 7:30 am

Ok I fixed it using three different suggestions from Joomla forum on Godaddy joom ver 1.5.15 sef yes and mod rewrite yes in config forwarded
trudyq.co.za to www.trudyq.co.za
trudyq.index.php to trudyq.co.za

so all will now be www.trudyq.co.za

code below fot .htaccess

Options +FollowSymLinks
DirectoryIndex index.php

RewriteEngine On
RewriteBase /
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.trudyq.co.za/ [R=301,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
RewriteCond %{HTTP_HOST} !^www\.trudyq\.co\.za
RewriteRule (.*) http://www.trudyq.co.za/$1 [R=301,L]
RewriteCond %{REQUEST_URI} !^/administrator

Averymedia
Joomla! Fledgling
Joomla! Fledgling
Posts: 2
Joined: Thu Apr 15, 2010 11:26 pm

Re: Redirect /index.php permanently?

Post by Averymedia » Fri Apr 16, 2010 6:23 pm

David's last post on this is a good start. Check your site on: http://www.searchmasters.co.nz/redirect-check/ to see if you are totally re-directed on all scenarios(html,htm,etc). Google likes to only have one.

There are some challenges in getting plugins to work when you redirect index.php, since the site is php based. I am still seeking out the answer (help?) as to whether or not .htaccess can be used, and if so what is the code? When I engage the index.php redirect, my client login plugin does not work however it redirects cleanly . I'm not that skilled in code. Anyone?

User avatar
092098jvm
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 230
Joined: Wed Aug 09, 2006 5:59 pm
Contact:

Re: Redirect /index.php permanently?

Post by 092098jvm » Wed May 26, 2010 12:14 am

Any solution for this one besides the .htaccess redirect? (which I'm sure will cause all sorts of problems down the road)

I like that Joomla adds the suffix for all of my sub-pages, but including the home page is a bad idea. I'm worried about duplicate content issues and it just doesn't look good. I can't think of any reason someone would want www.domain.com/index.php for a home page URL. ???

Davidq
Joomla! Apprentice
Joomla! Apprentice
Posts: 11
Joined: Thu Feb 28, 2008 5:55 pm

Re: Redirect /index.php permanently?

Post by Davidq » Mon Sep 06, 2010 9:56 am

I have always had the same issues, have a look at one of my sites www.rx-cash.biz and you will see that I fixed this using sh404 its the easiest way to fix this and they update their product often best money I have spent on any Joomla exstention. It will help you with redirect , duplicate content, etc it improved my alexa rank from 6 540 000 down to 3 829 142 in two weeks

User avatar
Agelor
Joomla! Intern
Joomla! Intern
Posts: 93
Joined: Tue Dec 01, 2009 4:43 am

Re: Redirect /index.php permanently?

Post by Agelor » Wed Sep 08, 2010 2:33 am

For a simple 301 redirect just add the following line in your .htaccess file:
redirect 301 /old-file-name.htm http://www.yourwebsite.com/new-file-name.htm
An eye for an eye only ends up making the whole world blind.

jogesh_p
Joomla! Apprentice
Joomla! Apprentice
Posts: 22
Joined: Thu Jun 16, 2011 6:29 am
Contact:

Re: Redirect /index.php permanently?

Post by jogesh_p » Fri Sep 09, 2011 12:45 pm

gabrieluk wrote:Hi,
I'm having the same issue:
"Redirect /index.php permanently?"
As this topic is a big issue,and this post has gone wild with variations(https,etc...)I would like a final confirmation of the best practise to have only one homepage:www.mysite.com indexed by Google.
In my case, SEF is on,and i have:
http://www.mysite.com
http://www.mysite.com/index.php
http://www.mysite.com/home.html
So the best would be:

### re-direct home.html to root / ###
RewriteCond %{THE_REQUEST} ^.*\/home\.html\ HTTP/
RewriteRule ^(.*)home\.html$ /$1 [R=301,L]

### re-direct index.php to root / ###
RewriteCond %{THE_REQUEST} ^.*\/index\.php\ HTTP/
RewriteRule ^(.*)index\.php$ /$1 [R=301,L]

hi i have the same issue but i don't know where i add the code for redirection??

here is joomla .htaccess codes
########## Begin - Joomla! core SEF Section
#
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
#
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script
RewriteCond %{REQUEST_URI} !^/index\.php
# and the request is for root, or for an extensionless URL, or the
# requested URL ends with one of the listed extensions
RewriteCond %{REQUEST_URI} (/[^.]*|\.(php|html?|feed|pdf|raw))$ [NC]
# and the requested path and file doesn't directly match a physical file
RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder
RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script
RewriteRule .* index.php [L]
#
########## End - Joomla! core SEF Section

plz help to redirect the index.php, home.html to direct http://www.mysite.com
please read the signature rules: http://forum.joomla.org/viewtopic.php?f=8&t=65


Locked

Return to “Search Engine Optimization (Joomla! SEO) in Joomla! 1.5”