I want to install modx in a "beta" folder on the live site before actually making it live.
Although installing in a folder does work -- all the links in my snippets, all the links in my custom built modules etc reference the root and so all the links are wrong and don’t work.
Similarly, all css stylesheets reference the root too.
I don’t want to be adding a "beta" into every path everywhere... as it would be very messy and confusing to keep a track of.
Is there a quick way to resolve all the links, paths and references work properly?
I tried doing a subdomain ie: beta.somesite.com which points to the folder -- but if I do this I get a lot of server 500 errors -- this might have something to do with the .htaccess file, but I don’t know what I should be changing.
Thanks
I looked at the source code of the "beta site" and it has the beta in the base href, so this is not the issue.
What I’m referring to is manager scripts, snippets, etc that refer the root, not what the end user sees.
I checked my modules and they do not have the base href in them (it didn’t parse them), so this might be part of the problem.
The modules never picks up any stylesheets I’ve written into modules because it doesn’t see the base href modx function.
In my snippets/modules it directly refers to root as being "/assets/modules/whatever...." like that -- so I would have to prepend a "beta" in front of every link.
I may try to install on a sub domain again and see if that makes any difference.
Other than this, is there anything else I can do?
Could you not change your config.inc.php to redefine base_path, base_url, manager_path etc. to add the /beta?
Use MODx, or the cat gets it!
I tried doing a subdomain ie: beta.somesite.com which points to the folder -- but if I do this I get a lot of server 500 errors -- this might have something to do with the .htaccess file, but I don’t know what I should be changing.
If you have SEF addresses, so it should look .htaccess
RewriteEngine On
[b]RewriteBase /beta[/b]
RewriteCond %{HTTP_USER_AGENT} ^.*internal\ dummy\ connection.*$ [NC]
RewriteRule .* - [F,L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]
The difference is only thickened line. I have the same code and I am with subdomain. Good luck.
I’m going to try your ideas now.
Its really annoying, because even PHX references the root, and other snippets/modules do too!
I got a subdomain working, it now picks up stylesheets in the /manager/ for modules section now -- but I have yet to test every module, every plugin, etc to see if they work.
Thanks
Another thing that worked for me (assuming your hosting on a linux server) was to create a symbolic link from the root /assets directory to /beta/assets but I’d use this solution only as a last resort.