SitePoint Sponsor

User Tag List

Page 2 of 2 FirstFirst 12
Results 26 to 49 of 49
  1. #26
    Sathish
    SitePoint Community Guest
    When I use this, the pages are not storing sessions :(
    The site has a member login and it workls but after that the session gets timed out


  2. #27
    ethan
    SitePoint Community Guest
    As of PHP 4.3.2, PATH_TRANSLATED is no longer set implicitly under the Apache 2 SAPI in contrast to the situation in Apache 1, where it's set to the same value as the SCRIPT_FILENAME server variable when it's not populated by Apache. This change was made to comply with the CGI specification that PATH_TRANSLATED should only exist if PATH_INFO is defined.

    Apache 2 users may use AcceptPathInfo = On inside httpd.conf to define PATH_INFO.

    It's a predefined variable, $_SERVER.

  3. #28
    Alan
    SitePoint Community Guest
    What a search engine sees is the page going out of the web server. don't see how we can achieve that without rewrite the pages.

    i have noticed reallysimpleserver at www.reallysimplesoft.com which does rewrite on the fly. never tried.

  4. #29
    SitePoint Evangelist -T-'s Avatar
    Join Date
    Jun 2002
    Posts
    444
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    cant you just use $_SERVER['REQUEST_URI'] instead of $PATH_INFO to get around this?

  5. #30
    PRD
    SitePoint Community Guest
    On servers with PHPSUEXEC, ForceType doesn't work. Instead use SetHandler, with everything else exactly the same, and it will work fine.

  6. #31
    SitePoint Enthusiast irkengir's Avatar
    Join Date
    Mar 2006
    Location
    UK
    Posts
    36
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    The zend framework uses query string like this:
    www.somesite.com/search/name/value/name/value
    e.g.
    www.somesite.com/search/lang/en/term/monkeys

    and then getParam('term') to retreieve them.
    This eliminates some of the problems described in this blog but does make URLs longer.

    Be aware if you are using any additional forward slashes in your URL that all your <link>, <img>, <script> and <a> tags with src or href attributes will be relative to the whole URL now. So you will often want to prefix them with / to make them relative to your domain.

    For example the page retreived with www.somesite.com/search/lang/en/str/monkeys may have <img src="gfx/small.png" alt=""> what would actually reference www.somesite.com/search/lang/en/str/monkeys/gfx/small.png, obviously not what you want. Don't use ../../ to solve this, it just gets silly instead try <img src="/gfx/small.png" alt="">

    Hope this helps someone.

  7. #32
    Kaya Casper
    SitePoint Community Guest
    Awesome article. One of the most straightforward and easy to implement I have found.

  8. #33
    Justin
    SitePoint Community Guest
    Thank you. Very simple.

  9. #34
    David
    SitePoint Community Guest
    Excellent read! Wow, I am going to be researching more about this. Thank you!

  10. #35
    baian
    SitePoint Community Guest
    Use ModRewrite!!
    That's the right way!!

  11. #36
    Jeff
    SitePoint Community Guest
    Never, never, never use the "404 error handler" method. It wouldn't work with suphp or php as cgi, the 404 headers would be already sent and all pages would be actually served as 404 errors.

    And most modern hostings use suphp or other suexec-like technique for user separation.

  12. #37
    Timothy
    SitePoint Community Guest
    ModRewrite!

    ModRewrite!

    It works.

  13. #38
    Nathan Samson
    SitePoint Community Guest
    Hi,

    I do have a problem with the PATH_INFO and the mod_rewrite solutions.

    The problem is in both cases the same:

    when I access
    mysite.com/index.php/whatever/url

    and on that generated page their is some code like
    <a href="/whatever/anotherurl"> My browser points that to /whatever/whatever/anotherurl. The same for src="/..." with images and css/javascript files. (The browser thinks we are in the directory /whatever while in fact we are in the / directory.)

    Ofcourse this renders my site usable. What am I doing wrong?

  14. #39
    ivanceras
    SitePoint Community Guest
    Use <keyword>.html for better search engine ranking results
    Search engine looks at /words/another/word/
    as a directory structure and will find "word" at the last as least important

  15. #40
    hoolio
    SitePoint Community Guest
    lClbLj hi! this is

  16. #41
    SitePoint Member
    Join Date
    May 2009
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello,

    Thanks for this article! very helpful...however, with the ForceType directive, I lose all the formatting and styling on my script page. Can this be fixed?

  17. #42
    SitePoint Member
    Join Date
    May 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Thanks for this information ......uts very userfull.....

  18. #43
    Serial Publisher silver trophy aspen's Avatar
    Join Date
    Aug 1999
    Location
    East Lansing, MI USA
    Posts
    12,937
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by covenantchild View Post
    Hello,

    Thanks for this article! very helpful...however, with the ForceType directive, I lose all the formatting and styling on my script page. Can this be fixed?
    Check your image and stylesheet include URLs, make them absolute instead of relative. That is likely the cause of your problem.
    Chris Beasley - I publish content and ecommerce sites.
    Featured Article: Free Comprehensive SEO Guide
    My Guide to Building a Successful Website
    My Blog|My Webmaster Forums

  19. #44
    SitePoint Guru D-flyer's Avatar
    Join Date
    Jan 2001
    Location
    Near a computer
    Posts
    782
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    ForceType doesn't seems to work (apache 2.2 / php 5.1.6)

    i tried
    Code:
    <Files tag> 
        #ForceType application/x-httpd-php 
        #SetHandler application/x-httpd-php 
        #SetHandler application/x-httpd-php5 
        #ForceType x-httpd-php 
        #ForceType application/x-httpd-php5 
        #AddHandler application/x-httpd-php5 .php
        ForceType php5-cgi
    </Files>
    Any more suggestions?

  20. #45
    SitePoint Member
    Join Date
    Mar 2008
    Posts
    0
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hm. Solution 3 does not seem to work for me either (apache 2.2, PHP 5.2.9, WindowsXPSP3).

    I've put the 3 lines in .htaccess, created a "test" file with only "<?php phpinfo(); ?>" in that same directory, but I keep getting that exact text instead of the PHP info.

  21. #46
    SitePoint Evangelist stonedeft's Avatar
    Join Date
    Aug 2009
    Posts
    586
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Hello ... I implemented method 2 but for some strange reason google didn't index my pages? Is it really safe to implement it. It only indexed the home page and some pages with a .php extension


    site:ad-traxx.com


  22. #47
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    I have tried method 2 a number of times. It works well but the irony is, pages using this method are not indexed by search engines.

    Search Engine Friendly? hmmm

    I have checked a couple on unimportant sites which have been live for over a year and only the static pages ending with .php are indexed, the dynamic stuff is not.

    Also Google Webmaster Tools reports each dynamic page as a 404 error.

    And most auto sitmap generating tools also report these pages as errrors and usually fail to include them in their output.

    Looks like I'm gonna have to try mod-rewrite.

  23. #48
    SitePoint Enthusiast Mounty's Avatar
    Join Date
    Mar 2008
    Location
    UK
    Posts
    90
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    try out this one for mod rewrite:

    Code:
    RewriteEngine On
    RewriteCond &#37;{QUERY_STRING} ^(.*)$
    RewriteRule ^(.*/)?([^/]+)/([^/]+) $1?$2=$3&%1 [L]
    RewriteCond %{QUERY_STRING} ^(.*)$
    RewriteRule ^.*$ index.php?%1 [L]
    It recursively iterates over the request and replaces 'field/val/' with 'field = val'. I don't know if it is technically SEO index friendly or not though.

  24. #49
    SitePoint Member
    Join Date
    Jan 2009
    Posts
    2
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Interestingly enough my re-write script was really simple and because I was already using $_SERVER('REQUEST_URI) to extract and then later explode the url into chuncks, I didnt even have to modify my original page handler.

    I simply send the data in the same format but mod-rewite avoids having to send a 404 error back to the user:

    ErrorDocument 404 /error.php

    RewriteEngine on
    #news index
    RewriteRule ^latest-news/ myPageHandlerScript.php
    RewriteRule ^latest-news myPageHandlerScript.php
    #news details
    RewriteRule ^latest-news/article/([a-zA-Z&0-9-.:@]+)/([0-9]+) myPageHandlerScript.php
    #news pagination
    RewriteRule ^latest-news/([0-9]+)/([0-9]+)/([0-9]+) myPageHandlerScript.php
    #projects
    RewriteRule ^our-work/([a-zA-Z&0-9-.:@]+)/([a-zA-Z&0-9-.:@]+)/([0-9]+) myPageHandlerScript.php
    #services
    RewriteRule ^our-services/ myPageHandlerScript.php
    #services details
    RewriteRule ^our-services/([a-zA-Z&0-9-.:@]+)/([0-9]+) myPageHandlerScript.php

    #services details
    RewriteRule ^sitemap/ sitemap.php
    RewriteRule ^sitemap sitemap.php

    etc

    It works really well, XML generatin works perfectly now and presents no unexpected errors, this one is SEO friendly throughout.

    You can see it in action here: http://www.bigwebcompany.co..uk


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
  •