Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2006-12-09 10:14:51

Juvenile
New Member
Registered: 2006-12-09
Posts: 5

Rewriting Rules for hiding subdirectory

Hi

I’m not too familiar with Apache’s rewriting rules (haven’t needed them so far), so I’d appreciate your help.

The situation is this:

I have a htdocs/domain_a directory which is configured in the hoster’s web interface as the root for domain_a (DocumentRoot, I guess). In that directory are two subdirectories: static and textpattern.

In static lies a single plain text file that needs to be available under its current URL. I have the rewriting rule for that working.

txp is the textpattern directory.

I would like everything except the “static file URL” to call textpattern.

I tried this in the domain_a-directory’s .htaccess:

RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteRule ^(.*) /txp/$1 [L]

and left the .htaccess of txp as it is (later I changed the RewriteBase to /txp, but to no avail).

textpattern seems to work (as far as I could see after an installation), but the URL in the browser bar is always “http://domain_a/txp/…”. I’d like that “/txp”-part to vanish.

How do I do that?

I set the URL in the admin interface accordingly. Didn’t help.

Any ideas?

Offline

#2 2006-12-09 18:13:43

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Rewriting Rules for hiding subdirectory

Is there a reason why you can’t install Textpatter in the root?

Offline

#3 2006-12-09 18:49:41

Juvenile
New Member
Registered: 2006-12-09
Posts: 5

Re: Rewriting Rules for hiding subdirectory

Hm, I thought it would be cleaner to separate Textpattern from other things.

Offline

#4 2006-12-09 21:58:10

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: Rewriting Rules for hiding subdirectory

Well, the easiest way to have a URL like site.com/ for your Textpattern site, is installing Textpattern in the root. Your other things, like the static files, can be kept separate by putting them in subdirectories, like you have now in /static/. The only thing you have to mind is not to use the names of those subdirectories for Textpattern sections.
You could redirect requests for site.com to site.com/txp/, but that will always show in the url.

Offline

Board footer

Powered by FluxBB