Hi, this is a similar question to an existing thread.
I'm using the default .htaccess to run the site and all prettyurls work fine but when creating a new subdomain cn.mydomain.com i get this error:
Internal Server Error
The server encountered an internal error or misconfiguration and was unable to complete your request.
Please contact the server administrator and inform them of the time the error occurred, and the actions you performed just before this error.
Do you know where and how i should change settings?
Thanks
Pretty URL - subdomain gives Internal Server Error
Re: Pretty URL - subdomain gives Internal Server Error
Using pretty URLs on a subdomain is the same as using it for a subfolder site, subfolder.domain.com or domain.com/subfolder/ so you need to use the RewriteBase /subfolder part of the htaccess...
Re: Pretty URL - subdomain gives Internal Server Error
Dr CSS, thanks for the reply.
could you be so kind to help me wrap this up?
i have mydmain.com/cn that i want to be cn.mydomain.com
I just tried this and wasn't successful. Am i missing anything?
could you be so kind to help me wrap this up?
i have mydmain.com/cn that i want to be cn.mydomain.com
Code: Select all
<IfModule mod_rewrite.c>
RewriteEngine on
#
#Sub-dir e.g: /cmsms
RewriteBase /cn
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>
Re: Pretty URL - subdomain gives Internal Server Error
First of all, are you sure it has something to do with the mod_rewrite part? The default .htaccess contains more than only rewrite stuff. You could try to minimalize it to rewriting and then try again.
Dr.Css can be right but I don't think it applies to all web server configurations. If in this case the subdomain must be seen as a subdir of the root domain, it could be possible that the .htaccess from the root domain applies to subdomain too (like inheritance). Been there once and took me some time to find this was the case.
Dr.Css can be right but I don't think it applies to all web server configurations. If in this case the subdomain must be seen as a subdir of the root domain, it could be possible that the .htaccess from the root domain applies to subdomain too (like inheritance). Been there once and took me some time to find this was the case.
Re: Pretty URL - subdomain gives Internal Server Error
Dr.CSS wrote:Using pretty URLs on a subdomain is the same as using it for a subfolder site, subfolder.domain.com or domain.com/subfolder/ so you need to use the RewriteBase /subfolder part of the htaccess...
I beg to differ: RewriteBase is used in the URL context when the site is in a folder relative to the domain root, i.e. given a domain (or sub-domain) like:velden wrote:Dr.Css can be right but I don't think it applies to all web server configurations.
- domain.com;
- www.domain.com (note that www is already a sub-domain of domain.com);
- www.sub.domain.com;
in neither of these cases you need anything more than RewriteBase /.
However in:
- domain.com/folder;
- www.domain.com/folder;
- www.sub.domain.com/folder;
you need RewriteBase /folder.
Further, you can even have these:
- domain.com/folder/subfolder;
- www.domain.com/folder/subfolder;
- www.sub.domain.com/folder/subfolder;
in which case you need RewriteBase /folder/subfolder.
That has been my experience so far and my interpretation of
http://httpd.apache.org/docs/current/mo ... ewritebase
Additionally check if the site works without mod_rewrite at all or with internal pretty_urls. You need (as velden stated) to debug a bit further. Otherwise we can only guess about the possible causes to your problem.velden wrote:First of all, are you sure it has something to do with the mod_rewrite part? The default .htaccess contains more than only rewrite stuff. You could try to minimalize it to rewriting and then try again.
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!