Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-16 17:59:12

Milo Bloom
New Member
Registered: 2005-08-09
Posts: 8

Clean URL problem and path_not_doc_root error; connected?

Well it seems I am experiencing two of the most commonly reported problems on this forum, but my searches haven’t come up with a fix yet.

I am building and testing a new site on a local installation. I would like to set up the site to use clean URLs but I’m getting the common 404 errors for interior links. I think I have mod rewrite set up in the htaccess file, but I’m not certain it’s right.

The only error I am getting reported by diagnostics is ‘path_not_doc_root’. Would this be causing the above problem?

Here is the diagnostics info

——————————

Textpattern version: 4.0 (r789)
last_update: 2005-10-10 15:58:24/2005-08-14 14:27:28
Document root: /Library/WebServer/Documents
$path_to_site: /Users/Martin/Sites/southernmtb
Textpattern path: /Users/Martin/Sites/southernmtb/textpattern
Permanent link mode: section_title
Temp folder: /private/var/tmp
Site URL: martin-harrisons-imac-g5.local/~Martin/southernmtb
PHP version: 4.3.11
Magic quotes: 1/0
MySQL: 4.0.25-standard
Locale: en_GB.UTF-8
Server: Apache/1.3.33 (Darwin) PHP/4.3.11
Apache version: Apache/1.3.33 (Darwin) PHP/4.3.11

Pre-flight check:
————————————
path_not_doc_root [ /Library/WebServer/Documents ]
————————————

.htaccess file contents:
————————————
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) – [PT,L]

RewriteRule </sup>(.*) /index.php
————————————

Offline

#2 2005-11-16 20:39:33

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Clean URL problem and path_not_doc_root error; connected?

1) Please update to the latest version, 4.0.2.

2) path_not_doc_root is not related to clean-urls.

3) For clean urls, first try these:
http://textpattern.com/weblog/20/clean-urls-on-different-hosts
if you can’t get it to work, you may try this:
http://textpattern.com/weblog/135/partly-messy-clean-urls-without-modrewrite-experimental

Offline

#3 2005-11-17 12:06:17

Milo Bloom
New Member
Registered: 2005-08-09
Posts: 8

Re: Clean URL problem and path_not_doc_root error; connected?

Thanks for the reply Sencer. I had read about the false positives on path_not_doc_root, but I just wanted to rule it out here. Now I know I can disregard it.

I’m new to both TXP and to running my own Apache installation, so it’s possible that I’m missing something totally obvious. I think mod rewrite should be on though, I’ve just taken a look in my httpd.conf file and found this

<code>
<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_METHOD} ^TRACE RewriteRule .* – [F]
</IfModule>
</code>

Plus of course, there’s every chance the problem may solve itself when I get to the stage of uploading to a different Apache set up on commercial hosting. So, in the spirit of inquiry, I think I might experiment with the ‘partly messy’ method for a bit, which sounds like it might fit my plans. I’ll let you know how I get on.

Offline

#4 2005-11-17 14:54:16

Milo Bloom
New Member
Registered: 2005-08-09
Posts: 8

Re: Clean URL problem and path_not_doc_root error; connected?

OK I’ve upgraded to 4.0.2 and my diagnostics are now reporting no errors. I’ve tried both of those options for clean URLs but neither works!

I’ve currently set up for the partly messy option. I have a htacces file that looks like this

<code>
#DirectoryIndex index.php index.html
#Options +FollowSymLinks
#RewriteBase /

#<IfModule mod_rewrite.c>
#RewriteEngine On
#RewriteCond %{REQUEST_FILENAME} -f [OR]
#RewriteCond %{REQUEST_FILENAME} -d
#RewriteRule ^(.+) – [PT,L]

#RewriteRule ^(.*) index.php
#</IfModule>

#php_value register_globals 0
ErrorDocument 404 /index.php
</code>

and a config.php as follows

<code>
<?php
$txpcfg[‘db’] = ‘sbikedb’;
$txpcfg[‘user’] = ‘root’;
$txpcfg[‘pass’] = ‘******’;
$txpcfg[‘host’] = ‘localhost’;
$txpcfg[‘table_prefix’] = ‘txp_’;
$txpcfg[‘txpath’] = ‘/Users/Martin/Sites/southernmtb/textpattern’;
$txpcfg[‘dbcharset’] = ‘latin1’;
define(‘PARTLY_MESSY’,true);
?>
</code>

but I’m still getting the following error when set to clean urls

<code>Not Found
The requested URL /~Martin/southernmtb/articles/ was not found on this server.

Apache/1.3.33 Server at martin-harrisons-imac-g5.local Port 80</code>

Any more advice or ideas would be welcome, but I think I may just have to develop my site on messy URLs for now and look at this again when I get it onto the live server.

Offline

#5 2005-11-17 16:04:54

Sencer
Archived Developer
From: cgn, de
Registered: 2004-03-23
Posts: 1,803
Website

Re: Clean URL problem and path_not_doc_root error; connected?

Is it a local install?

Then it’s probably your apache configuration. Open httpd.conf and seach for Allowoverride None and set it to AllowOverride All. Look in the apache documentation to learn more about configuring apache.

Offline

#6 2005-11-17 18:34:18

Milo Bloom
New Member
Registered: 2005-08-09
Posts: 8

Re: Clean URL problem and path_not_doc_root error; connected?

Yes it is a local install, so I’d guess it is down to my Apache configuration.

I’ve changed every instance of Allowoverride in httpd.conf, but it’s still not playing! As this site is not going to be served from this machine when it goes live though, I don’t see any point in wasting more time over it. I can keep a record of what will need altering if clean URLs work when I get it onto the live server.

Thanks for your time though, much appreciated.

Offline

#7 2005-11-18 06:44:34

Innbound
New Member
Registered: 2005-11-18
Posts: 5

Re: Clean URL problem and path_not_doc_root error; connected?

I was just browsing the forums for such a thread to proove to myself that indeed I wasn’t running in my own endless loop trying to figure out this problem with having Apache on a local machine and still getting clean url’s.
The following may or may not help with earlier versions of Apache but it’s good with 2.0…

Here’s my setup:

Textpattern version: 4.0.2 (r1076)
last_update: 2005-11-14 00:41:10/2005-11-01 21:01:00
Document root: C:/Server (C:\Server)
$path_to_site: C:\Server
Textpattern path: C:\Server\textpattern
Permanent link mode: year_month_day_title
upload_tmp_dir: C:\tmpulfiles
Temp folder: C:\Server\textpattern\tmp
Site URL: localhost:8080
PHP version: 5.0.5
server_time: 2005-11-18 00:22:28
MySQL: 5.0.15-nt
Locale: English_United States.1252
Server: Apache/2.0.55 (Win32) PHP/5.0.5
Apache version: Apache/2.0.55 (Win32) PHP/5.0.5

.htaccess file contents:
————————————
#DirectoryIndex index.php index.html

#Options +FollowSymLinks

#RewriteBase /

#<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php </IfModule>

#php_value register_globals 0

————————————

As you can see I’ve commented out everything in the .htaccess file… further than that… in my Apache httpd.conf file I have Allowoverride set to None. This works because I put:

RewriteBase /

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php </IfModule>

into Apache’s httpd.conf file between the <Directory “C:/Server”> </Directory> tags… which looks like:

#
  1. This should be changed to whatever you set DocumentRoot to.
    #
    <Directory “C:/Server”>
#
  1. Possible values for the Options directive are “None”, “All”,
  2. or any combination of:
  3. Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
    #
  4. Note that “MultiViews” must be named explicitly —- “Options All”
  5. doesn’t give it to you.
    #
  6. The Options directive is both complicated and important. Please see
  7. http://httpd.apache.org/docs-2.0/mod/core.html#options
  8. for more information.
    # Options Indexes FollowSymLinks
#
  1. AllowOverride controls what directives may be placed in .htaccess files.
  2. It can be “All”, “None”, or any combination of the keywords:
  3. Options FileInfo AuthConfig Limit
    # AllowOverride None
#
  1. Controls who can get stuff from this server.
    # Order allow,deny Allow from all
    #
    RewriteBase /

<IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php </IfModule> </Directory>

#

I know this doesn’t help anyone who has a host that likes to spend their days lounging while expecting their clients to busily use .htaccess files everywhere… but for the rest of us it’s nice not to have to be taxing the entire chain of folders with Apache needlessly searching for such things that could simply be introduced just once at server start-up. For reference:

http://httpd.apache.org/docs/2.0/howto/htaccess.html.en#when

….. actually, since 1) this was my first time posting anything here and 2) not having a clue as to why Textile would choose to butcher what I pasted into the message window… the above really doesn’t look like what’s in my httpd.conf file. Anyone know how to turn Textile off for posting? That’s extremely annoying after taking the time to document something like this ( or maybe I just haven’t learned to enjoy learning text input from scratch all over again YET ) :/

Last edited by Innbound (2005-11-18 06:59:33)

Offline

#8 2005-11-18 09:52:16

Milo Bloom
New Member
Registered: 2005-08-09
Posts: 8

Re: Clean URL problem and path_not_doc_root error; connected?

Innbound – thanks for your reply. This sounds interesting, so I’d like to know I’m seeing your httpd.conf file correctly. The link below will show you how to post code blocks.

<a href=“http://textpattern.com/faq/43/how-do-i-post-tags-and-code-on-the-forum”>FAQ: How do I post tags and code on the forum?<a>

Offline

#9 2005-11-18 10:52:46

Innbound
New Member
Registered: 2005-11-18
Posts: 5

Re: Clean URL problem and path_not_doc_root error; connected?

Milo Bloom, thanks for the link!!! After a 3 day marathon of reading about Textpattern I still feel like I’m banging my head against a wall in alot of ways. Your help is much appreciated – and Needed! lol

Lemme try this again…

#
#This should be changed to whatever you set DocumentRoot to.
#
<code><Directory “C:/Server”>
#
#Possible values for the Options directive are “None”, “All”,
#or any combination of:
#Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
#Note that “MultiViews” must be named explicitly —- “Options All”
#doesn’t give it to you.
#
#The Options directive is both complicated and important. Please see
#http://httpd.apache.org/docs-2.0/mod/core.html#options
#for more information.
#
<code>Options Indexes FollowSymLinks
#
#AllowOverride controls what directives may be placed in .htaccess files.
#It can be “All”, “None”, or any combination of the keywords:
#Options FileInfo AuthConfig Limit
#
<code>AllowOverride None
#
#Controls who can get stuff from this server.
#
<code>Order allow,deny
<code>Allow from all
#
<code>RewriteBase /

<code><IfModule mod_rewrite.c>
<code>RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) – [PT,L]

<code>RewriteRule ^(.*) index.php
<code></IfModule>
</Directory></code>
#

The trick is to keep the RewriteBase / to /IfModule parts within the Directory tags

Yikes man, this textile thing’s simply a pain in the @$$ to work with. What ever happened to just copying and pasting stuff and it JUST WORKING without feeling like you’re translating mattress tags into ancient Greek? grrrr, I’ll adjust somehow ;) Hope the above helps you get those clean url’s.

Offline

Board footer

Powered by FluxBB