Problem with referer/links in backend - htaccess problem (?)
Hi all,
I have problem with settings of my Contao instance respectively with referer links in backend. My Contao instance is installed in subdirectory (representing domain of 3rd level).
My domain: http:\\www.domain.com is in directory \www\
My subdomain: http:\\lukas.domain.com is in directory \www\subdom\lukas\
All links in backend are directing e.i.: http://lukas.domain.com/subdom/lukas/contao/main.php?...
I need to setup links to: http://lukas.domain.com/contao/main.php?... (withou subdom/lukas)
I have in root of my web (\www\) following .htaccess file content:
Code:
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 %{REQUEST_URI} !^subdom/
RewriteCond %{REQUEST_URI} !^/subdom/
RewriteCond %{HTTP_HOST} ^(www\.)?(.*)\.([^\.]*)\.([^\.]*)$
RewriteCond %{DOCUMENT_ROOT}/subdom/%2 -d
RewriteRule (.*) subdom/%2/$1 [DPI]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^domains/[^/]+/(.+[^/])$ /$1/ [R]
RewriteCond %{REQUEST_FILENAME} -d
RewriteRule ^subdom/[^/]+/(.+[^/])$ /$1/ [R]
I need to resolve this problem due wrong refering page in backend. When I am clicking on Save and go back or Go back backend will redirect my to wrong link (non existing) and default page is shown.
Can you anybody help my what is wrong set on my hosting/.htaccess file?
Thanks Lukas
Re: Problem with referer/links in backend - htaccess problem
Start your install tool in
http://lukas.domain.com/contao/install.php
not in
http://lukas.domain.com/subdom/lukas/contao/install.php
Set the website path in system/localconfig.php to ''
Code:
$GLOBALS['TL_CONFIG']['websitePath'] = '';
Open your backend here
http://lukas.domain.com/contao/
not here
http://lukas.domain.com/subdom/lukas/contao/
Your FE is here
http://lukas.domain.com/
Don't manipulate the .htaccess file, simply use .htaccess.default by renaming it.
Set a 301 redirect for your www subdomains in your server account. Direct to the domain, not to the folder.
Re: Problem with referer/links in backend - htaccess problem
Thanks Andreas,
I found problem with .htaccess file. I removed line: