Support Forums

index.php and canoncial forms

This is a discussion on index.php and canoncial forms within the Modules / Plugins / Modifications forums, part of the Developer Forums category; Perhaps a problem as my rankings seem to be dropping on french property for sale . Google is caching index.php ...


Go Back   68 Classifieds Forums > Developer Forums > Modules / Plugins / Modifications

Reply
 
Thread Tools Display Modes
Old 04-22-2008, 04:40 PM   #1
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,233
Rep Power: 53
seymourjames has a spectacular aura about
Default index.php and canoncial forms

Perhaps a problem as my rankings seem to be dropping on french property for sale.

Google is caching index.php and domain/ but not index.html which i prefer it not to do anyway. I do not understand why as I have changed all my links in layout.tpl to domain/ and all those links pointing inside the system to nofollow so it should not be coming from there. Index.php should not be accessible. My sitemap file does not mention index.php either.I could exclude it in robots.txt file but i am afraid that it may mean there are some links I do not know about deeper inside the encrypted part of the system.

In my htaccess file I have the standard

#RewriteRule ^index\.html$ index.php [NC]

and in the SEO module I have the standard
$before = array(
.
.
.
"'(?<!/)".URL."/index.php'",
.
.
.
$after = array(
.
.
.
"index.html",
.
.

Any ideas? what is strange is that index.html does not seem to exist even in the eyes of google or when I manually type it into the browser. What do I need to change or am i worrying for nothing.
seymourjames is offline   Reply With Quote
Old 04-22-2008, 04:47 PM   #2
cwp
Senior Member
 
cwp's Avatar
 
Join Date: Jun 2007
Posts: 296
Rep Power: 18
cwp is a jewel in the rough
Default

where is index.html located?

http://www.french-property-sale.eu/ doesn't work.
__________________
Version 4.0.3 Developer

Last edited by seymourjames; 10-24-2008 at 08:50 PM. Reason: page does not exist and google is trying to get it
cwp is offline   Reply With Quote
Old 04-22-2008, 05:07 PM   #3
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,233
Rep Power: 53
seymourjames has a spectacular aura about
Default

I have not got an index.html file defined explicitly anywhere. I only have it declared in the .htaccess file and in the mod_user.php file which came as standard. I was thinking about deleting both of those lines because I want everything to go to www.domain/ anyway. Google isn't getting index.html

The real problem though is index.php; How is google finding it when I am locking it out of the login, user and admin pages etc. I cannot find index.php in the code of my site to be called from anywhere except the .htaccess file, the mod_user.php file., templates_c and it gets called internally through form post actions for example (no a hrefs or things like that).

The SEO module doesnt seem to be rewriting the URLs of pages like these below either but it does it for page 1 no problem.

http://www.mydomain/toplistings.php?pg=new&page=2
http://www.mydomain.eu/toplistings.php?pg=new&page=3

I would like to modify this - is it in the pagination file or do I need to go deeper.?

Last edited by seymourjames; 05-06-2008 at 09:58 PM. Reason: indexing of urls
seymourjames is offline   Reply With Quote
Old 04-22-2008, 05:23 PM   #4
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,315
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

If you wish to remove index.html then you can delete the two lines in the mod_user file of the SEO. Keep in mind the first portion is what to find and the second is the replacement.

For the toplistings that would be from the mod_user as well. I will see about getting it sorted.
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 04-22-2008, 05:38 PM   #5
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,233
Rep Power: 53
seymourjames has a spectacular aura about
Default

Many thanks. I was unsure how to get the top listings working as it seems to affect featured, new and top listings, some of which have multiple pages. It seemed strange that page 1 was rewritten but other pages were not. The multiple pages in a category work fine so i thought it may be something I had done.

Basically I am trying to get google to focus on www.mydomain.com/ and not other equivalent pages. Is it necessary to redirect mydomain.com to www.mydomain.com as well or does google have that resolved already? sorry for all the questions but I want to get it right and build another 68C site now I have my lesser site pretty much done.
seymourjames is offline   Reply With Quote
Old 04-22-2008, 05:52 PM   #6
68 Classifieds Staff
 
Eric Barnes's Avatar
 
Join Date: Mar 2006
Location: Belmont, NC
Posts: 5,315
Rep Power: 125
Eric Barnes is a jewel in the rough
Default

I just had a look at my local mod_user file and it should be rewriting the toplistings.

Can you send me a pm with a copy and paste of your mod_user file?
__________________
Eric Barnes
68 Classifieds Developer
Customer Area | Issue Tracker | Documentation | 68C Mods | 68 @ Twitter | My Modules
Eric Barnes is offline   Reply With Quote
Old 04-23-2008, 03:33 AM   #7
All Hands On Deck
 
 
Join Date: Mar 2008
Posts: 2,233
Rep Power: 53
seymourjames has a spectacular aura about
Default

Found some nice code that others may wish to try. In the .htaccess file

#rewrite index.php to root

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /index\.php\ HTTP/
RewriteRule ^index\.php$ http://www.french-property-sale.eu/ [R=permanent,L]

#rewrite all non www pages


RewriteCond %{HTTP_HOST} ^french-property-sale\.eu$
RewriteRule ^.*$ http://www.french-property-sale.eu%{REQUEST_URI} [R=permanent,L,NC]

The first bit of code makes sure the search engines get the root / and not the index.php file. It works well if there is a index.html file as well. The second bit of code turns all non-www pages into www ones. There should be no canonical problems now and search engines just get one 'home page' so to speak. Hope others find this code useful. Make a backup of your .htaccess file always. It is so easy to make a mess. So now for example index.php renders as I prefer to http://www.french-property-sale.eu .

Last edited by seymourjames; 05-06-2008 at 09:57 PM.
seymourjames is offline   Reply With Quote
Reply

Thread Tools
Display Modes



All times are GMT -4. The time now is 05:03 AM.


Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0