#1
  1. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    7
    Rep Power
    0
    I am creating a PHP/MySQL based portion of my site. I am very new to php so I was just passing all variable in the URL (page.php3?blah=blah). Yesterday I read the article on php builder about making a "false" directory structure. Well, no matter what I did I could not get his method to work. Then I found another post on here with using ErrorDocument 404. I did this method and it worked great BUT I am trying to make my site search engine friendly.

    If I use ErrorDocument 404 in my .htacces file, will search engines just get the 404 and leave? Or will they think it is a real structure and spider my site? If they will just leave after the 404 what can I do?

    I tried using this in my .htacces file and it did not work:

    <Files local>
    ForceType application/x-httpd-php3
    </Files>

    Does the above mean I have a directory named local and a script named local in that directory?

    ------------------
  2. #2
  3. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Does the above mean I have a directory named local and a script named local in that directory?

    No. <Files> is for files while <Directory> is..guess what?

    >>If they will just leave after the 404 what can I do?

    Do 404 logging and check its stats and fix it.
  4. #3
  5. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    7
    Rep Power
    0
    You may not have know what I was refering to. Here is the URL of what I am talking about:
    http://www.devshed.com/Talk/Forums/F...ML/000960.html

    Here is the a link to the article I was talking about:
    http://phpbuilder.com/columns/tim20000526.php3

    My question might make a little more sense now.

    ------------------
  6. #4
  7. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    So have you found a solution yet?

    >>will search engines just get the 404 and leave?
    I am not sure what your 404 means, if it's a redirection to call up your php script, then search engines probably won't.

    >>Does the above mean I have a directory named local and a script named local in that directory?

    I assumed you have no access to httpd.conf, you can then stick with .htaccess. This example means any file/script named "local", not "llocal" nor "locale". This technically would speed things up.

    <FilesMatch "^local$">
    ForceType application/x-httpd-php3
    </FilesMatch>

    Don't blindly follow the example of that article from phpbuilder.
  8. #5
  9. No Profile Picture
    Gödelian monster
    Devshed Regular (2000 - 2499 posts)

    Join Date
    Jul 1999
    Location
    Central Florida, USA
    Posts
    2,307
    Rep Power
    61
    Here's another post where I expand a bit on the idea you link to above:
    http://www.devshed.com/Talk/Forums/F...ML/000083.html

    Bear in mind that I have not had time to extensively test this for performance/optimization OR for online errors from different browsers/http spiders.

    I do think, though, that the search engines, since they are just using HTTP and 'mimicking' the action of a browser, will not see any error message, but simply the page they are redirected to.
  10. #6
  11. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    7
    Rep Power
    0
    I am using this in my .htaccess file and it is working right now:

    ErrorDocument 404 /path/to/file.php

    Then I use request_uri to parse the url where they came from, and I have all the variables in the URL. I am doing the exact thing that rycamor explains in his link.

    I tried that little code of yours in my .htaccess file, but it did not work at all.

    I am passing all the variables in the url, so it looks like a real directory structure in the browser. For example:

    Before I had:

    page.php3?id=1&cat=2&parent=3

    Now I have:

    /1/2/3

    The second example will only work when I use the ErrorDocument 404 and point it to my PHP script.

    Should I use the <Directory> command in my .htacces file?

    ------------------
  12. #7
  13. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    >>Should I use the <Directory> command in my .htacces file?

    You can't. Read the "Context" line at -> http://www.apache.org/docs/mod/core.html#directory
    That is, server config and virtual host, not for .htaccess.
  14. #8
  15. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    7
    Rep Power
    0
    What should I use since the file match did not work?

    ------------------
  16. #9
  17. No Profile Picture
    freebsd
    Guest
    Devshed Newbie (0 - 499 posts)
    I am still unclear whether your problem is a PHP issue or Apache issue. Let's put PHP aside and check out -> http://www.devshed.com/Talk/Forums/F...ML/000114.html to see the logic of how <FilesMatch> works.

    Though, I have a feeling your case works best with <LocationMatch>.
  18. #10
  19. No Profile Picture
    Junior Member
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jun 2000
    Posts
    7
    Rep Power
    0
    I think it might be an issue with appache. My host is pretty lame and does not allow very many things at all.

    In a few weeks I am moving to a co-dedicated server (me and 3 other sites). It might just be easier to try it then when I am not on a virtual host.

    ------------------

Similar Threads

  1. How would one make a pay-per-click search engine?
    By bllott in forum PHP Development
    Replies: 1
    Last Post: February 13th, 2004, 12:06 AM
  2. search engine in java
    By mahnaz in forum Java Help
    Replies: 2
    Last Post: February 11th, 2004, 06:03 AM
  3. search engine project
    By mahnaz in forum Project Help Wanted
    Replies: 0
    Last Post: February 10th, 2004, 08:15 AM
  4. iframes that are orphaned by search engine.
    By junpei in forum HTML Programming
    Replies: 2
    Last Post: February 6th, 2004, 12:15 PM
  5. Dynamic search, php mysql
    By jonny5005 in forum PHP Development
    Replies: 5
    Last Post: January 26th, 2004, 10:17 PM

IMN logo majestic logo threadwatch logo seochat tools logo