Pretty URL - subdomain gives Internal Server Error

The place to talk about things that are related to CMS Made simple, but don't fit anywhere else.
Post Reply
User avatar
magallo
Dev Team Member
Dev Team Member
Posts: 121
Joined: Thu Mar 24, 2011 12:37 am

Pretty URL - subdomain gives Internal Server Error

Post by magallo »

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
Magal Hezi
Pixel Solutions, Technology Partners
magal@pixelsolutions.biz | pixelsolutions.biz

Image
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am
Location: Arizona

Re: Pretty URL - subdomain gives Internal Server Error

Post by Dr.CSS »

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...
User avatar
magallo
Dev Team Member
Dev Team Member
Posts: 121
Joined: Thu Mar 24, 2011 12:37 am

Re: Pretty URL - subdomain gives Internal Server Error

Post by magallo »

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

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>
I just tried this and wasn't successful. Am i missing anything?
Magal Hezi
Pixel Solutions, Technology Partners
magal@pixelsolutions.biz | pixelsolutions.biz

Image
User avatar
velden
Dev Team Member
Dev Team Member
Posts: 3497
Joined: Mon Nov 28, 2011 9:29 am
Location: The Netherlands

Re: Pretty URL - subdomain gives Internal Server Error

Post by velden »

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.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1967
Joined: Mon Jan 29, 2007 4:47 pm

Re: Pretty URL - subdomain gives Internal Server Error

Post by Jo Morg »

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...
velden wrote:Dr.Css can be right but I don't think it applies to all web server configurations.
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:
- 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
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.
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.
"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!
Post Reply

Return to “The Lounge”