Thread: [phpodpworld-users] SEF in phpODPWorld
Status: Beta
Brought to you by:
hansfn
|
From: Darryl K. <dk...@se...> - 2007-03-26 00:45:01
|
I'm trying to set up a .htaccess file to do search engine friendly urls on a phpODPWorld site that I put together. Does anyone have any examples of how to do this? I've found that it's a bit difficult. Darryl Koster dk...@se... |
|
From: Darryl K. <dk...@se...> - 2007-03-26 23:55:07
|
I have $config["use_rewrite"] = true; set in the config.inc.php, and am using example1.htaccess as my .htaccess file. When I click on say, "Personal Pages" on my site I get a 404 "The requested URL /Computers/Robotics/Personal_Pages was not found on this server." I enabled the rewrite log, and this is what I got below for that: ----------------------------------------------------------------------- 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] add path info postfix: /www/robotmoz.com/public_html/Computers -> /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] strip per-dir prefix: /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages -> Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] applying pattern '^/index.php$' to uri 'Computers/Robotics/Personal_Pages' 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] add path info postfix: /www/robotmoz.com/public_html/Computers -> /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] strip per-dir prefix: /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages -> Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] applying pattern '^/.*' to uri 'Computers/Robotics/Personal_Pages' 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] add path info postfix: /www/robotmoz.com/public_html/Computers -> /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] strip per-dir prefix: /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages -> Computers/Robotics/Personal_Pages 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir /www/robotmoz.com/public_html/] applying pattern '^/(.*)' to uri 'Computers/Robotics/Personal_Pages' 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] [www.robotmoz.com/sid#757578][rid#9605b8/initial] (1) [perdir /www/robotmoz.com/public_html/] pass through /www/robotmoz.com/public_html/Computers ----------------------------------------------------------------- Any idea on what I'm doing wrong here? Darryl Koster |
|
From: Hans F. N. <Han...@hi...> - 2007-03-27 00:19:58
|
* Darryl Koster <dk...@se...> [2007-03-27]: > I have $config["use_rewrite"] = true; set in the config.inc.php, and am > using example1.htaccess as my .htaccess file. > > When I click on say, "Personal Pages" on my site I get a 404 "The > requested URL /Computers/Robotics/Personal_Pages was not found on this > server." Thx for the added info. I must admit that I didn't tell the complete truth - I use the content of example1.htaccess directly inside the Apache config file (httpd.conf/apache.conf or whatever it's called on your machine). This might make a difference because (quote from http://httpd.apache.org/docs/2.2/mod/mod_rewrite.html#rewriterule): When using the rewrite engine in .htaccess files the per-directory prefix (which always is the same for a specific directory) is automatically removed for the pattern matching and automatically added after the substitution has been done. This feature is essential for many sorts of rewriting; without this, you would always have to match the parent directory, which is not always possible. This seems to indicate that you should replace all (three) occurences of "^/" with just "^" in the .htaccess file. Let me know if it helps (and I'll update the docs/example files). The reason I think this should work is: > I enabled the rewrite log, and this is what I got below for that: > ----------------------------------------------------------------------- > > 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] > [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir > /www/robotmoz.com/public_html/] add path info postfix: > /www/robotmoz.com/public_html/Computers -> > /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages > 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] > [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir > /www/robotmoz.com/public_html/] strip per-dir prefix: > /www/robotmoz.com/public_html/Computers/Robotics/Personal_Pages -> > Computers/Robotics/Personal_Pages > 192.168.168.163 - - [26/Mar/2007:16:42:54 --0700] > [www.robotmoz.com/sid#757578][rid#9605b8/initial] (3) [perdir > /www/robotmoz.com/public_html/] applying pattern '^/index.php$' to uri > 'Computers/Robotics/Personal_Pages' We are trying to match something that starts with a slash with something that doesn't... Regards, Hans PS! www.robotmoz.com looked really nice. At first glance there is only one minor glitch (on my screen) - the languages/links in the "This category in other languages" box is almost impossible to see. |
|
From: Hans F. N. <Han...@hi...> - 2007-03-26 06:13:55
|
* Darryl Koster <dk...@se...> [2007-03-26]: > I'm trying to set up a .htaccess file to do search engine friendly urls > on a phpODPWorld site that I put together. > > Does anyone have any examples of how to do this? I've found that it's a > bit difficult. The files you downloaded when you installed phpODPWorld contains example1.htaccess and example2.htaccess. I do agree that these files aren't trivial, but unless you tell us what you are trying to achieve *and* what you have tried that didn't work, it's very hard to help you. On http://odp.no/ I'm using example1.htaccess (renamed to .htaccess of course). Regards, Hans |