I want to know how to stop this from happening.
I currently have several domains hosted on one server and the latest beta of serendipity installed in the root folder. All the domains are inside folders as I'm sure you have all encountered before. The problem is when viewing one of these other domains, for instance if I go to...
sub-folder-domain.com/myfolder/
instead of...
sub-folder-domain.com/myfolder/index.php
the first one inherits all the behavior of sub-folder-domain.com/ without images and all that.
This is particularly annoying as now when I access these pages (luckily none of them are live) I have to always specify the page I want to visit rather than just specifying the folder and having the index take it's place.
how can I fix this?
sub-folders (seperate domains) inherit .htaccess behavior
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Re: sub-folders (seperate domains) inherit .htaccess behavio
Have you looked into the .htaccess file of "myfolder"? Maybe it has some directions in it that cause the behavior...
Regards,
Garvin
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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Did you try temporarily removing your .htaccess file? Do you have an actual URL to look at the problem, please?
Regards,
Garvin
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/
# 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/
Ok, removing it did help.
The root folder is the folder for http://www.civilissues.com/
A sub-folder that contains another domain is http://www.main-dish.com/ the sub-folder for this would be civilissues.com/maindish/
Now if you view main-dish.com and look at the sample layout (it's a work in progress) and then view this link...
http://www.main-dish.com/v2/admin/
compared to what it's supposed to look like at...
http://www.main-dish.com/v2/admin/index.php
I think you will get the idea of what is going on.
The root folder is the folder for http://www.civilissues.com/
A sub-folder that contains another domain is http://www.main-dish.com/ the sub-folder for this would be civilissues.com/maindish/
Now if you view main-dish.com and look at the sample layout (it's a work in progress) and then view this link...
http://www.main-dish.com/v2/admin/
compared to what it's supposed to look like at...
http://www.main-dish.com/v2/admin/index.php
I think you will get the idea of what is going on.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
If removing it helps, it seems to me the ErrorDocument or DirectoryIndex directives in there seem to be wrong. I get completely different HTML output for the two paths you mentioned, which means that calling the URL without a path names includes a files specified in the directive, which isn't what you want. So either patch up the .htaccess or configure your Apache VirtualHost to include a DirectoryIndex setting.
Regards,
Garvin
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/
# 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/
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
Then please past your .htaccess file and I'll try to patch it up. Also look out if you have more .htaccess files in your subdirectores. I may also need the virtualhost configuration from your apache configuration to tell you how to fix things.
The regexps in .htaccess are not neccessary. Only the two directives I talked about...they seem to point to a wrong directory/file.
Regards,
Garvin
The regexps in .htaccess are not neccessary. Only the two directives I talked about...they seem to point to a wrong directory/file.
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/
# 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/
Here is the .htaccess file for the root directory which can be reached via http://www.civilissues.com/
I do have a .htaccess file in a sub-directory that is named cptnwinky, for the domain http://www.cptnwinky.com/ however this domain uses the latest stable version of Serendipity and does not suffer from this problem, rather than mod_rewrite it uses the error handling option.
Other than that the other sub-directories have no .htaccess files of their own.
I do not have access to the virtualhost config as this is a paid host environment. If it's necessary though I can write the host and ask them for a copy.
Thanks for your help.
Code: Select all
# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php
php_value session.use_trans_sid 0
php_value register_globals off
RewriteEngine On
RewriteBase /
RewriteRule ^archives([/A-Za-z0-9]+)\.html index.php?url=/archives/$1.html [L,QSA]
RewriteRule ^PAT_ARCHIVES_SHORT index.php?url=/archives/$1-short.html [L,NC,QSA]
RewriteRule ^([0-9]+)[_\-][0-9a-z_\-]*\.html index.php?url=$1-article.html [L,NC,QSA]
RewriteRule ^feeds/(.*) index.php?url=/feeds/$1 [L,QSA]
RewriteRule ^unsubscribe/(.*)/([0-9]+) index.php?url=/unsubscribe/$1/$2 [L,QSA]
RewriteRule ^approve/(.*)/(.*)/([0-9]+) index.php?url=approve/$1/$2/$3 [L,QSA]
RewriteRule ^delete/(.*)/(.*)/([0-9]+) index.php?url=delete/$1/$2/$3 [L,QSA]
RewriteRule ^(admin|entries)(/.+)? index.php?url=admin/ [L,QSA]
RewriteRule ^archive$ index.php?url=/archive [L,QSA]
RewriteRule ^categories/([0-9]+) index.php?url=/categories/$1 [L,QSA]
RewriteRule ^(index|atom|rss|b2rss|b2rdf).(rss|rdf|rss2|xml)$ rss.php?file=$1&ext=$2
RewriteRule ^plugin/(.*) index.php?url=plugin/$1 [L,QSA]
RewriteRule ^index\.(html?|php.?) index.php?url=index.html [L,QSA]
RewriteRule ^htmlarea/(.*) htmlarea/$1 [L,QSA]
RewriteRule (.*\.html?) index.php?url=/$1 [L,QSA]
<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 s9yOther than that the other sub-directories have no .htaccess files of their own.
I do not have access to the virtualhost config as this is a paid host environment. If it's necessary though I can write the host and ask them for a copy.
Thanks for your help.
-
garvinhicking
- Core Developer
- Posts: 30022
- Joined: Tue Sep 16, 2003 9:45 pm
- Location: Cologne, Germany
- Contact:
There, it's as I told you:
This tells that if you request a link off a subdirectory without a file, your browser will redirect you to /index.php.
Put a .htaccess in your subdirectory with this:
You may need to adjust "index.php" to the index file actually inside the subdirectory...
Regards,
Garvin
Code: Select all
# BEGIN s9y
ErrorDocument 404 /index.php
DirectoryIndex /index.php
Put a .htaccess in your subdirectory with this:
Code: Select all
ErrorDocument 404 index.php
DirectoryIndex index.php
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/
# 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/