Hi,
I have serendipity installed in my root html directory (not my root directory, of course, but directly in htdocs, so that when you visit my site, it goes straight to my blog), but I also have a subdirectory with plain HTML in it, totally unconnected to serendipity.
So if my site is http://www.mysite.org, and when you visit http://www.mysite.org/subdirectory, you just get my main page.
I know this is because serendipity is using url rewriting so that when you'd get a 404 error, it'll redirect you to the main page instead of actually giving you the 404 error. But what if there actually is a "/subdirectory/index.html"? Why then wouldn't it just let you view the page?
Can I fix this somehow?
non-Seredipity sub-directories?
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: non-Seredipity sub-directories?
If you are using mod_rewrite you need to put a .htaccess in this subdirectory:
Regards,
Garvin
Code: Select all
RewriteEngine off
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/
# 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/
Just throwing in my two cents on how I got around this...
I had s9y installed in a virtual domain at me.tld.com/, but I was going to be using a lot of other sub dirs under /
I wanted to keep it so s9y would be at /, but I didn't want to have to create a .htaccess file for each subdir. I also liked how 404s would redirect to the main blog. So I moved s9y to /blog/, and then put this in /.htaccess file:
This redirects http://me.tld.com/ to http://me.tld.com/blog/. An added bonus is that if there is a 404 error, it will first see if the file exists under /blog/ and try to redirect there. If it doesn't, it redirects to /blog/. (So you could go to me.tld.com/admin and get the s9y admin...)
Hope this is at least interesting...
I had s9y installed in a virtual domain at me.tld.com/, but I was going to be using a lot of other sub dirs under /
I wanted to keep it so s9y would be at /, but I didn't want to have to create a .htaccess file for each subdir. I also liked how 404s would redirect to the main blog. So I moved s9y to /blog/, and then put this in /.htaccess file:
Code: Select all
ErrorDocument 404 /blog/
# php variables I (and s9y) like
php_value session.use_trans_sid 0
php_value register_globals off
php_value magic_quotes_gpc off
redirect /index.php http://me.tld.com/blog/
Hope this is at least interesting...
-
Mickeybyte
- Posts: 2
- Joined: Thu May 25, 2006 10:28 pm
Hey,
had the same problem, but after adding .htaccess file in the subdir with "RewriteEngine off" in it, the problem wasn't solved!
In fact it was only partially solved.
When I tried: http://my.site.com/nons9y/ it gave me the s9y site
When I tried: http://my.site.com/nons9y/index.php it worked great.
I've solved it by adding the following in the .htaccess file in the nons9y subdir:
After this, it also worked without specifying the index.php in the URL.
Maybe something to add to the S9Y faq?
Greetz,
Mickeybyte
had the same problem, but after adding .htaccess file in the subdir with "RewriteEngine off" in it, the problem wasn't solved!
In fact it was only partially solved.
When I tried: http://my.site.com/nons9y/ it gave me the s9y site
When I tried: http://my.site.com/nons9y/index.php it worked great.
I've solved it by adding the following in the .htaccess file in the nons9y subdir:
Code: Select all
RewriteEngine off
DirectoryIndex index.phpMaybe something to add to the S9Y faq?
Greetz,
Mickeybyte