Page 1 of 1

subdomains and pretty URLS set up

Posted: Wed Jul 15, 2020 9:51 am
by johnboyuk1
Can someone help me please with my set up! I 'm having trouble!

I have a CMS installation here

www.mydomain.com/myfolder

and a subdomain set up to point to that folder:

myfolder.mydomain.com

I have pretty URLs set up

At the moment, the homepage woks, but when I try and access any other page I get an 'internal server error' message.

For example

myfolder.mydomain.com/about-us

Gives the error

But myfolder.mydomain.com/index.php?page=about-us

Works ok

... which leads me to suspect its a pretty URL/url rewrite issue but I'm not sure what settings I should be using, here' the relevant bit from my htaccess:

Code: Select all

<IfModule rewrite_module>
	RewriteEngine on
	# If your CMSMS installation is in a subdirectory of your domain, you need to specify the relative path (from the root of the domain) here.
	# In example: RewriteBase /[subdirectory name]
	RewriteBase /myfolder
	
	# Rewrites URLs in the form of /parent/child/grandchild but only rewrites if the requested URL is not a file or directory.
	RewriteCond %{REQUEST_FILENAME} !-f
	RewriteCond %{REQUEST_FILENAME} !-d
	RewriteRule ^(.+)$ index.php?page=$1 [QSA]
</IfModule>
Can anyone help me out?

Thanks!

Re: subdomains and pretty URLS set up

Posted: Wed Jul 15, 2020 2:20 pm
by DIGI3
If you're using a subdomain, then effectively the site is in root, so

Code: Select all

RewriteBase /myfolder
should be changed to

Code: Select all

RewriteBase /

Re: subdomains and pretty URLS set up

Posted: Wed Jul 15, 2020 2:23 pm
by johnboyuk1
Ah! Thanks DIGI3 ...you're awesome ;)