tttpapi
tttpapi

Reputation: 887

Hide folders in url, rewrite url

I have a project with a special hosting structure:

I have to set the baseUrl config.baseURL = http://example.com/domains/example.com/. Url example http://example.com/domains/example.com/index.php?id=4.

If I use only config.baseURL = http://example.com/. The site works but sessions do not work and user cannot log (he can log in but after reload he is logged out)

I need to have url only with http://example.com/index.php?id=x.

There is 1 htaccess in the www folder with these rules.

RewriteEngine On

RewriteCond %{REQUEST_URI} !^domains/
RewriteCond %{REQUEST_URI} !^/domains/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)$
RewriteCond %{DOCUMENT_ROOT}/domains/%2 -d
RewriteRule (.*) domains/%2/$1 [DPI]

RewriteCond %{HTTP_HOST} ^www\.(.*)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,QSA,L]

RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]

And another is in my project folder.

I am sure there will be just an easy htaccess rule. But I do not have any experience with it. I tried to use the solution from Mod Rewrite Hide Folder but it did not help. I tried to use it in both htaccess files.

Any ideas?

Thank you!

Upvotes: 1

Views: 458

Answers (1)

Kitze
Kitze

Reputation: 595

You could try setting the TypoScript option config.absRefPrefix to /domain/www.example.com/

See http://buzz.typo3.org/people/soeren-malling/article/baseurl-is-dead-long-live-absrefprefix/ and http://wiki.typo3.org/TSref/CONFIG

Upvotes: 2

Related Questions