Page 1 of 1

static pathname problem

Posted: Thu May 04, 2006 1:21 pm
by Dawn
I've installed Serendipity to make it accessable via domain.com/blog. Now I've created a subdomain called blog.domain.com and set the DocumentRoot (Apache2) to the same dir which has domain.com/blog.

I took a look at the .htaccess file which is in /blog and I found the reason why it doesnt works:

Code: Select all

# BEGIN s9y
DirectoryIndex /blog/index.php
php_value session.use_trans_sid 0
php_value register_globals off

<Files *.tpl.php>
    deny from all
</Files>

<Files *.tpl>
    deny from all
</Files>

<Files *.sql>
    deny from all
</Files>

<Files *.inc.php>
    deny from all
</Files>

<Files *.db>
    deny from all
</Files>

# END s9y
The reason are static pathnames. It would be nice if there would be a solutions for this problem because Serendipity really rocks... If there is a way I can change the php-code, please let me know.

I use Serendipity 1.0 Beta 2 on a Debian 3.1 System together with Apache2.

Re: static pathname problem

Posted: Thu May 04, 2006 2:05 pm
by garvinhicking
Hi!

That'S right, you cannot make Serendipity listen on two different paths "/" and "/blog/". You need to decide which one to use, and make the other address forward to that location.

In your case I'd drop the domain.com/blog URL and make it forward to blog.domain.com.

Best regards
Garvin

Posted: Thu May 04, 2006 4:52 pm
by Dawn
Thanks for your explanation. But isn't it possible to change the paths to relative paht names...? Then it doesn't depend (only if I would use mod_rewrite) if I call it over blog.domain.com or domain.com/blog..

Greets and best Regards,
Dawn

Posted: Thu May 04, 2006 7:53 pm
by garvinhicking
Hi!

Sadly the .htaccess file needs an absolute path name for ErrorDocument, so it is not possible to use relative paths. The reason is that when you fetch a URL like /blog/archives/2005/xxx.html, the path would need to be "../../index.php". But when the URL is /blog/archives/index.html the ErrorDocument would need to be "../index.php". So you can only put it absolutely there.

Plus, the permalinks need to be matched to the full absolute path.

So only if you do not use URL rewriting it would be possible to make serendipity ignore which path it is running in.

Best regards,
Garvin