Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-08-13 18:49:34

tmacwrig
Archived Plugin Author
Registered: 2004-03-06
Posts: 204
Website

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

#2 2006-08-13 19:00:43

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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>
&lt;IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d [OR] RewriteCond %{REQUEST_URI} ^\/subdirectory\/ RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php &lt;/IfModule> </code> </pre></notextile>

or (if the above doesn’t work):

<notextile><pre>
<code>
&lt;IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} !^\/subdirectory\/ RewriteRule ^(.*) index.php
&lt;/IfModule>
</code>
</pre></notextile>

——-

In the subdirectory:
<notextile><pre>
<code>
&lt;IfModule mod_rewrite.c> RewriteEngine On RewriteCond %{REQUEST_FILENAME} -f [OR] RewriteCond %{REQUEST_FILENAME} -d RewriteRule ^(.+) – [PT,L]

RewriteRule ^(.*) index.php &lt;/IfModule> </code> </pre></notextile>

Last edited by ruud (2006-08-13 19:07:50)

Offline

#3 2006-08-13 19:19:22

tmacwrig
Archived Plugin Author
Registered: 2004-03-06
Posts: 204
Website

Re: TXP in both root & subdirectory... mod_rewrite workarounds?

Thanks, but still no luck… ugh.

Offline

#4 2006-08-13 19:21:50

tmacwrig
Archived Plugin Author
Registered: 2004-03-06
Posts: 204
Website

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

#5 2006-08-13 19:35:02

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

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

Board footer

Powered by FluxBB