homepage Welcome to WebmasterWorld Guest from 54.197.94.241
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

    
How To Update Permanent Redirect for index.html
actolearn




msg:4530520
 1:59 am on Dec 23, 2012 (gmt 0)

Hello ~ Getting below message from a link checker and can't figure out how to fix.

List of redirects
The links below are not broken, but the document does not use the exact URL, and the links were redirected. It may be a good idea to link to the final location, for the sake of speed.

warning Lines: 98, 104 http://www.example.com/index.html redirected to http://www.example.com/
Status: 301 -> 200 OK

This is a permanent redirect. The link should be updated.


This is the link referenced above:
<a href="index.html">Home</a>&nbsp;&nbsp;


What's weird is I have this exact link in 3 places on that page yet it's only one of them that I'm getting the above message for (line 98) and only for my home page (index.html) although link is part of my navigation at bottom of ALL of my website pages.
..........................

In case you need to see, below is part of what I have in my htaccess file:

# keeps index.html part of url hidden
# always keep above canonical code
RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^/]+/)*index\.html\ HTTP/
RewriteRule ^(([^/]+/)*)index\.html http://www.example.com/$1 [R=301,L]

# canonical always to www
RewriteCond %{HTTP_HOST} !^(www\.example\.com)?$
RewriteRule (.*) http://www.example.com/$1 [R=301,L]

 

not2easy




msg:4530532
 4:09 am on Dec 23, 2012 (gmt 0)

Your link should be
<a href="http://www.example.com/">Home</a>&nbsp;&nbsp;


You're forcing an extra rewrite by using the page name that you have redirected.

actolearn




msg:4530543
 5:31 am on Dec 23, 2012 (gmt 0)

Thank you. That fixed it. Thought I had tried that but must have done something wrong before.

Should I change my index.html link to the full url on JUST my home page or everywhere on ALL MY PAGES?

Just my home page - correct?

not2easy




msg:4530551
 5:41 am on Dec 23, 2012 (gmt 0)

No, it needs to be changed everywhere. If Google finds a link they want to try to index it and you don't want them seeing the same page with 2 different URLs.

actolearn




msg:4530629
 4:01 pm on Dec 23, 2012 (gmt 0)

Well, this has been invaluable information since it means that every single one of my website pages is wrong.

In the process of fixing now. A BIG thank you.

g1smd




msg:4530642
 6:17 pm on Dec 23, 2012 (gmt 0)

Clicking a link in internal navigation should never result in a redirect. The link should point to the real URL.

The redirects in htaccess are for when other sites link to the wrong version.

actolearn




msg:4530648
 7:04 pm on Dec 23, 2012 (gmt 0)

The link should point to the real URL.

Not sure I understand. Are you disagreeing with the response I was given above?

To me the REAL URL is actually http://www.example.com/index.html. Is that what I should change that link to?

INSTEAD OF
http://www.example.com/
I should change to
http://www.example.com/index.html
instead?
.................
Sorry - I truly believe I can learn anything but I'm oftentimes a little slow...

g1smd




msg:4530654
 8:57 pm on Dec 23, 2012 (gmt 0)

URLs are "used out" there on the web.

Filenames are used "here" inside the server.

The two are not at all the same thing, they are merely related by the actions of the server configuration.

The real URL is "http://www.example.com/".

The real internal reference is "/index.html".

People out there "on the web" use a web-based reference system: URLs. They have no need to know what the files inside the server are called.

However, if people do directly request those internal resources, you should redirect the request to tell them to request the correct URL.

actolearn




msg:4530672
 10:57 pm on Dec 23, 2012 (gmt 0)

Got it -
http://www.example.com/
is correct.

You were just explaining further...

Thank you.

Global Options:
 top home search open messages active posts  
 

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved