Here’s my problem. I’m a real noob concerning server issues.
I have my main website at the root of my server and I created a folder in order to host another website, running Kirby.
So, at first, it was possible to access this second website at the address mywebsite.com - This website is for sale! - mywebsite Resources and Information. by changing the RewriteBase in the .htaccess file to
> RewriteBase /mysecondwebsite
So, it’s better but still weird.
The website is still impossible to access through mywebsite.com but the link www.mywebsite.com is working.
Then, if I try to access any subpage, I got an Internal Server Error, but the link is working when I add index.php into it (for example, mywebsite.com/index.php/subpage)
The panel is still not working.
# Kirby .htaccess
# rewrite rules
<IfModule mod_rewrite.c>
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on
# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite
# Set the RewriteBase to:
RewriteBase /tipotetik_beta
# 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
RewriteRule ^site/(.*) index.php [L]
# block all files in the kirby folder from being accessed directly
RewriteRule ^kirby/(.*) 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]
</IfModule>
# Additional recommended values
# Remove comments for those you want to use.
#
# AddDefaultCharset UTF-8
#
# php_flag short_open_tag on
Here’s my .htaccess file. How can I make sure that my mod_rewrite is enabled ?
You RewriteBase should be either commented out or set to the root, as explained above, because from the perspective of the domain, your project is not located in a subfolder.
You can check if mod_rewrite is enabled by creating a php file in the root directory , e.g. info.php with the following content
In fact, I’ve just tried different things. And now I’m almost done with that. Subpages and Panel work, homepage works when I have the address www.mywebsite.com, the last thing that doesn’t is the homepage with the link mywebsite.com
Here’s my .htaccess now
# Kirby .htaccess
# rewrite rules
<IfModule mod_rewrite.c>
Options +FollowSymLinks
# enable awesome urls. i.e.:
# http://yourdomain.com/about-us/team
RewriteEngine on
# make sure to set the RewriteBase correctly
# if you are running the site in a subfolder.
# Otherwise links or the entire site will break.
#
# If your homepage is http://yourdomain.com/mysite
# Set the RewriteBase to:
RewriteBase /
# 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
RewriteRule ^site/(.*) index.php [L]
# block all files in the kirby folder from being accessed directly
RewriteRule ^kirby/(.*) 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]
</IfModule>
# Additional recommended values
# Remove comments for those you want to use.
#
# AddDefaultCharset UTF-8
#
# php_flag short_open_tag on
Have you pointed your domain without www to the same folder? Nevertheless you should decide which domain name you want to use for the website (either with or without www) and then redirect the one to the other, so as to prevent duplicate content.