SitePoint Sponsor

User Tag List

Results 1 to 7 of 7
  1. #1
    SitePoint Member
    Join Date
    Aug 2009
    Location
    Johannesburg, South-Africa
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    PHP front controller and Google indexing issues

    Hey,

    In my project htaccess file I direct any requests to the index.php file and allow my controller to build the site based on the url call. In principle a call might be http://www.domain.com/about/ which my controller will break up, check "about" to the view files and if exists build a template. In short, there is no such file as about/ (which is obvious) and no about.php in the folder http://www.domain.com/ but the actual file (if it even exists) could be in http://www.domain.com/pages/view_about.tpl

    The SEO guy came back today saying that the reason why the site is not indexing properly is because when google checks the url called, the header will return a 302 not-found and does not index that location anymore?

    Now either the SEO guy is taking a chance or I am doing something wrong. Can someone maybe give me some input on this? What is the industry norm surrounding this topic? If the SEO guy is taking changes, is there a URL or some reference you can give so that I can reply with a valid argument and not just be "A guy on a forum told me so"?

  2. #2
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    Well some code would be nice. What is in the .htaccess file? Does PHP send a 302 HTTP Header when it routes? (I mean: header( '...Send HTTP Status Here...' );)

    I personally never listen to "SEO guys", more often then not, they believe they know what they are talking about after reading a single piece of information of questionable nature.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  3. #3
    SitePoint Member
    Join Date
    Aug 2009
    Location
    Johannesburg, South-Africa
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Haha thanks for your reply.

    The .htaccess file rewrite rules are pretty standard, but here you go:

    Code:
    # Send all universal error documents to the index.php file
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^.*$ index.php [L]
    
    #dont send the apache error document, but rather send the not found to index.php
    ErrorDocument 404 index.php
    You can have a look at http://www.grandreefcasino.com which is the project in question

  4. #4
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    I see no problems, Fiddler shows the site is returning a 200 HTTP Status when I put "/about" in the address bar for the site in question.

    Btw, you can improve your rewrite query: Simpler pattern along with removing a head ache if you ever use query strings some where for some reason.
    Code:
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule .? index.php [L,QSA]
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  5. #5
    SitePoint Member
    Join Date
    Aug 2009
    Location
    Johannesburg, South-Africa
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your reply.

    It appears that the main concern according to him is that it does a 302 redirect (which I cannot see anywhere?) when doing a response like: http://www.grandreefcasino.com/start.php on http://web-sniffer.net

    I am pretty convinced that there is no other redirect rules except sending all requests to the index.php file, which to my knowledge isnt a redirect? He says the 302 implicates the indexing of the site on google. I dont know?

  6. #6
    . shoooo... silver trophy logic_earth's Avatar
    Join Date
    Oct 2005
    Location
    CA
    Posts
    9,013
    Mentioned
    8 Post(s)
    Tagged
    0 Thread(s)
    The reason he is seeing 302 is because WebSniffer.net does not understand the concept of Sessions or Cookies. However it will not affect Google's spiders or any other search engine.
    The 302 status is "Found" a redirection that Google is more then capable of understanding. And it causes no problems.
    Logic without the fatal effects.
    All code snippets are licensed under WTFPL.


  7. #7
    SitePoint Member
    Join Date
    Aug 2009
    Location
    Johannesburg, South-Africa
    Posts
    21
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thank you for your help today! I found the "problem" which isnt really a problem, more a session issue

    BTW, how does google handle 302 OK responses? Does this count against ones ranking in any way?


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •