Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
TXP in both root & subdirectory... mod_rewrite workarounds?
Hey…
This has been eating up my time today – I’m wondering if anyone has a fix that I could use.
I have a 4.0.3 running in the domain root, and another installation in a subdirectory. So this means that the installation in the subdirectory will only work for the /subdirectory/ address, but if I try to access it’s sections, for instance, /subdirectory/section/ will be handled by the root installation rather than the subdirectory installation. Get it? I really can’t stand .htaccess, and none of the tricks I’ve tried have worked.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} ^/?staging/
RewriteRule ^(.+) - [PT,L]
RewriteRule ^(.*) index.php
</IfModule>
Doesn't seem to work.
Thanks for any wisdom!
Last edited by tmacwrig (2006-08-13 18:50:36)
Offline
Re: TXP in both root & subdirectory... mod_rewrite workarounds?
You could try this (not tested). Two .htaccess files:
——-
In the root dir:
<notextile><pre>
<code>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_URI} ^\/subdirectory\/
RewriteRule ^(.+) – [PT,L]
or (if the above doesn’t work):
<notextile><pre>
<code>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^\/subdirectory\/
RewriteRule ^(.*) index.php
</IfModule>
</code>
</pre></notextile>
——-
In the subdirectory:
<notextile><pre>
<code>
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} -f [OR]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^(.+) – [PT,L]
Last edited by ruud (2006-08-13 19:07:50)
Offline
Re: TXP in both root & subdirectory... mod_rewrite workarounds?
Thanks, but still no luck… ugh.
Offline
Re: TXP in both root & subdirectory... mod_rewrite workarounds?
Ah! That’s the problem – they had, for some reason, a blank .htaccess in the subdirectory. Thanks!
Offline
Re: TXP in both root & subdirectory... mod_rewrite workarounds?
Actually…. now that I’ve tested it myself it also works when I simply used the default TXP .htaccess file in both root and subdirectory.
Last edited by ruud (2006-08-13 19:36:33)
Offline