Can't access the panel on 1&1 Webserver

It’s not possible to access my panel when I have a RewriteCond defined for redirecting to the www subdomain.
After pressing “Login” the page reloads and nothing happens.

Site is published on a 1&1 Webserver with PHP 7.X and mod_rewrite enabled…
Never had this Problem on other hosters before.

These are the relevant things in my .htaccess
I had to move the RewriteCond to the top in order to make it work in the frontend. By commenting out these two lines it is possible to access the panel… but ofcourse this is no option.

# Kirby .htaccess

# rewrite rules
<IfModule mod_rewrite.c>

# enable awesome urls. i.e.:
RewriteEngine on

# In some enviroments it's necessary to
# set the RewriteBase to:
RewriteBase /

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

# block text files in the content folder from being accessed directly
RewriteRule ^content/(.*)\.(txt|md|mdown)$ index.php [L]

# block all files in the site folder from being accessed directly
# except for requests to plugin assets files
#RewriteRule ^assets/plugins/([a-zA-Z0-9\.\-_%=]+)/(.*)$ site/plugins/$1/assets/$2 [L,N]
#RewriteCond $1 !^plugins/[a-zA-Z0-9\.\-_%=]+/assets/.*
RewriteRule ^site/(.*) index.php [L]

# block direct access to kirby and the panel sources
RewriteRule ^(kirby|panel\/app|panel\/tests)/(.*) index.php [L]

# make panel links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^panel/(.*) panel/index.php [L]

# make site links work
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*) index.php [L]


Have you tried to put that before the RewriteBase?

On the other hand, if you domain is registered with 1und1, you might as well set the redirect in the 1und1 admin area instead of in the .htaccess.

Putting it before the RewriteBase does not work.

The redirect options in the admin area are not what I want and they actualy not work that great.
I want the redirect to be as dynamic as possible.

domain,com > redirects to > www.domain,com
domain,com/page > redirects to > www.domain,com/page

Thats not possible in the admin area…

Whats also weird is that the asset URLs are beeing rendered without www. Even if the redirect is set and working for the frontend.

1 Like

I don’t quite see why creating a redirect from non-www to www (Verwendungsart Weiterleitung) shouldn’t work in the 1und1 Domain administration.

But anyway, try to set the URL in your config.php

c::set('url', '');
1 Like

The 1&1 solution gives me a “ERR_TOO_MANY_REDIRECTS”.

Setting the URL did the trick! Thank you.

Really strange behavior :thinking: