static pathname problem

Found a bug? Tell us!!
Post Reply
Dawn
Regular
Posts: 69
Joined: Thu May 04, 2006 11:46 am

static pathname problem

Post 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.
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Re: static pathname problem

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Dawn
Regular
Posts: 69
Joined: Thu May 04, 2006 11:46 am

Post 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
garvinhicking
Core Developer
Posts: 30022
Joined: Tue Sep 16, 2003 9:45 pm
Location: Cologne, Germany
Contact:

Post 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
# Garvin Hicking (s9y Developer)
# Did I help you? Consider making me happy: http://wishes.garv.in/
# or use my PayPal account "paypal {at} supergarv (dot) de"
# My "other" hobby: http://flickr.garv.in/
Post Reply