Forum Moderators: Robert Charlton & goodroi

Message Too Old, No Replies

Changed index.html to index.php, Search Rank drop, 0 backlinks

         

ArronC

12:13 am on Sep 10, 2008 (gmt 0)

10+ Year Member



I recently changed my site's index.html to index.php...
Is this the reason for my page rank plummet?

my keyword was bringing about 300 to 500 unique visitors a now, not that's all gone.

That was the only change I recall that could have affected that. I did my fair share of searching the web to see if there has ever been similar problems but to no avail. Has anyone ever experienced this? or know if it will be rectified?

g1smd

6:31 am on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



You should be linking to www.domain.com/ and then search engines would have no idea that you changed the technology running the site. The DirectoryIndex directive (in Apache) lets you have any named file as the index file.

Any direct request for a named index file should be served a 301 redirect back to a URL with the index file filename omitted, simply ending with a trailing / at the end. There are hundreds of threads about that in the Apache forum here.

In any case, should that have been some filename other than index.html then you could have simply set up an internal server rewrite such that when thatfile.html was requested, the content was silently delivered by thatfile.php without exposing the name of that file.

URLs do not have to depend on the filenames that reside on your server.

ArronC

7:31 am on Sep 10, 2008 (gmt 0)

10+ Year Member



I don't totally understand this, however, I recreated the index.html and it redirections to index.php, will that do the trick?

g1smd

7:44 am on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I assume you used a meta refresh, or somesuch, to do that.

In that case, absolutely not. You're making things worse.

.

By adding your redirect, you might be preserving some traffic in the short term.

In the long term you are still serving Duplicate Content at www.domain.com/index.php and at www.domain.com/ and that will cost you.

.

Link to "www.domain.com/" so that search engines index that URL.

Use .htaccess to redirect named index files:

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?¦php¦cgi¦cfm¦pl¦aspx?¦jspx?).*\ HTTP/
RewriteRule ^(([^/]*/)*)index\.(html?¦php¦cgi¦cfm¦pl¦aspx?¦jspx?)$ http://www.domain.com/$1? [R=301,L]

Beware that you will need to change each ¦ to be the proper pipe symbol before using this code.

ArronC

8:52 am on Sep 10, 2008 (gmt 0)

10+ Year Member



I replaced each broken bar with the proper pipe symbol and added the code to the .htaccess file.

I then deleted index.html

I'm not 100 percent sure what is meant by "Link to "www.domain.com/" so that search engines index that URL"

BeeDeeDubbleU

9:28 am on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



By linking to "www.domain.com/" you are taking the name of the default page out of the picture and you can make it what you like - php, html or whatever.

g1smd

9:36 am on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Change the links on your pages to say www.domain.com/ instead of /index.html or /index.php as they do now.

Likewise for folders, link to /folder/ without the index file filename included.

ArronC

11:36 am on Sep 10, 2008 (gmt 0)

10+ Year Member



sigh, I apologize for not being able to understand this right now...
are you saying to rename /public_html/ folder to www.domain.com/?

my site never did say www.domain.com/index.html or www.domain.com/index.php in the browser. All I did was delete index.html and and started using index.php

or are you saying all back links should be www.domain.com/?

g1smd

11:45 am on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Do not rename folders on your server.

I am talking only about the format of links within your site.

StaceyJ

2:10 pm on Sep 10, 2008 (gmt 0)

10+ Year Member



Let me see if I can help explain, if you don't mine.

are you saying to rename /public_html/ folder to www.domain.com/?

No, definitely not!

my site never did say www.domain.com/index.html or www.domain.com/index.php in the browser.

When you went/go to your home page, what did/does it say in the address bar?

All I did was delete index.html and and started using index.php

If your website homepage was www.domain.com/index.html and now is www.domain.com/index.php, or anything else, the links within your website should reference only www.domain.com/ with no filename after the trailing /

or are you saying all back links should be www.domain.com/?

Yes, as long as you want those links to point to the home page.

Does that clarify?

ArronC

7:05 pm on Sep 10, 2008 (gmt 0)

10+ Year Member



In the address bar www.example.com turns into www.example.com/ no problem with that.

I suppose my real issue is I don't understand why goolge isn't seeing index.php...does the .htaccess redirect solve that?

[edited by: tedster at 7:08 pm (utc) on Sep. 10, 2008]
[edit reason] switch to example.com - it can never be owned [/edit]

g1smd

7:51 pm on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



What is in your DirectoryIndex directive?

I assume that index.php is listed there?

.

Other than that I don't understand the question.

In what way does Google not "see it"?

fishfinger

8:58 pm on Sep 10, 2008 (gmt 0)

10+ Year Member



When linking to your home page in code within your site use

<a href="/"></a> or <a href="http://www.mydomain.com/"></a>

instead of

<a href="/index.whatever"></a>

Use the same method for linking to folders that have a default / root / index file i.e.

<a href="/foldername/"></a>

and not

<a href="/foldername/index.whatever"></a>

ArronC

9:00 pm on Sep 10, 2008 (gmt 0)

10+ Year Member



g1smd...the site goes to index.php fine

I assumed that deleting my index.html file and adding index.php was the reason for me going from a page 1 rank of the keyword, to a 0 page rank.

I suppose to need to sharpen up on my website skills because I have no indea what is meant by DirectoryIndex directive

As it stands, what does the .htaccess redirect do?

fishfinger...Thanks, I've always used <a href="http://www.mydomain.com/"></a> and not <a href="/index.whatever"></a>

I guess that was why I was so confused with what i was being asked to do

[edited by: ArronC at 9:10 pm (utc) on Sep. 10, 2008]

g1smd

9:56 pm on Sep 10, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



The .htaccess redirect stops index pages being indexed as both "/" and "/index.html", avoiding Duplicate Content.

It forces the shorter URL to be the one, and that's the one that most search engines prefer to list if they find both.

ArronC

1:50 am on Sep 11, 2008 (gmt 0)

10+ Year Member



Thank You for all your help, I'm not certain why I ended up with a Google rank of 0, however I'll be optimistic about it.

fishfinger

12:10 pm on Sep 11, 2008 (gmt 0)

10+ Year Member



You don't really have 0 - just that that's a new url that Google hasn't exported PR to so it's visible in the toolbar. Once the cache for your site shows that the change has been picked up you should be back where you were before.

g1smd

12:37 pm on Sep 11, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



There shouldn't be a new URL. If the site refers to the root as "/" then the actual internal filename is irrelevant, and will never be seen on the outside world. The named index file filename redirect takes care of that.

ArronC

9:10 am on Sep 12, 2008 (gmt 0)

10+ Year Member



g1smd...the rewrite worked great until I noticed I couldn't log into my Forum Admin anymore :( sigh, I had to remove it because it wouldn't stop asking me to re enter my password. When I did, I could finally log in.

I just thought you should know

I'm getting use to accepting my losses

[edited by: ArronC at 9:11 am (utc) on Sep. 12, 2008]

g1smd

9:43 am on Sep 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Add a RewriteCond before the rule to exclude the rule running for your Admin folder.

ArronC

12:16 pm on Sep 12, 2008 (gmt 0)

10+ Year Member



lol I wouldn't begin to know how to do that
but you have influenced to learn these codes in the future, but right now, it would be impossible for me to learn from scratch.

g1smd

12:37 pm on Sep 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Umm. You'll need these:

RewriteCond - the "command"
%{REQUEST_URI} - the thing you are testing
! - this means "NOT"
^ - this means "begins with"
admin - the actual path it will apply to.

.

Put it all together and you get something like:

RewriteCond %{REQUEST_URI} !^admin

and that line goes immediately before the rule that is causing you the problem at the moment.

ArronC

1:58 pm on Sep 12, 2008 (gmt 0)

10+ Year Member



LOL...this took me sometime to figure out, for something that was so plug and play...

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]*/)*index\.(html?¦php¦cgi¦cfm¦pl¦aspx?¦jspx?).*\ HTTP/
RewriteCond %{REQUEST_URI} !^/forum/adm/
RewriteRule ^(([^/]*/)*)index\.(html?¦php¦cgi¦cfm¦pl¦aspx?¦jspx?)$ http://www.example.com/$1? [R=301,L]

you must really love this
:D
Thank you

g1smd

2:17 pm on Sep 12, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I am not so sure if you need the leading / on the REQUEST_URI URL or not.

I can never remember. Testing will show you which works... with, or without.

ArronC

5:59 am on Sep 13, 2008 (gmt 0)

10+ Year Member



it didn't work without it

g1smd

7:01 am on Sep 13, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Ah, thanks for confirming. I always forget which is which.

ArronC

12:19 pm on Sep 20, 2008 (gmt 0)

10+ Year Member



Hey g1smd....so my site returned to a #3/Page 1 ranking on Google. So I'm now at ease and my traffic should return to normal.

I don't know what happened, or if the Rewrite helped, however, it was dropped from the ranking, with a 0 rank for about 5 weeks.