Any way to set base url in the without reinstalling? - modx

I built a site for a client on my subdomain. I then transferred it accross - files and data base - to a new server.
Problem is base url no longer works.
I manually set it, eg:
<base href="http://www.website.com/">
But this seems to make all links open in new tabs.
Is there any way I can fix this via the database or config file?

After moving a MODX site to another server, domain or subdomain, you need to check the following places and take actions:
clear the site cache (!)
check via FTP if cache folder is really empty
if not -> set permissions, ask your hoster if 777 or 755
edit templates to contain new base href
check your .htaccess if you have old rewrite rules set
check core/config for old paths or urls
also check config.inc.php inside root folder, inside /manager/ and inside /connectors/.

Most of the paths and urls in Modx are based off of the site-wide settings. There are probably several that you would have to adjust. core_path is the most basic of these.
These can be found under the gear in the top right corner of the manager, under 'system settings'
Also, if this and the config file are not enough alone, this SO question suggests re-installing the setup folder and re-running the initial setup.
Move modx site from subfolder to root folder

Related

How to change the root of a subdirectory

On my xampp server, I have several folders in /projects/ with different projects. The problem is when I make the link to the home page, I can't simply put in / because instead of going to localhost/projects/currentproj/, it goes to localhost.
Normally, I would just set all the href links to /localhost/projects/currentproj/, but I upload this project to a website so the website would have an incorrect link. I have temporarily set the links as local ones, with ./ instead of /, but I would like a more permanent solution if possible, and I don't know how to format htaccess files.
In other words, I would like to know how to change the root of a subdirectory, so all files in that folder go to the root of their own folder when linked to the root, rather than leaving that subdirectory.
EDIT:
Here is a perfect example of why this would be helpful.
That is what my 404 page looks like when I go to localhost/projects/currentproj/sub/example. If I could use / for the root of the currentproj folder, this wouldnt be an issue.
Here is an example of someone else with the same issue, but they never got a proper answer. There has to be a way to change this in the htaccess file.

Trying to move Drupal install TO subdirectory

Okay, so I've searched everywhere and while I can find plenty of stuff about moving a Drupal install out of a subdirectory I can't find anything on moving one into a subdirectory. I've recently taken over this project and it was developed without me so I've been landed in it here.
The problem is that the site was developed in the root of a dev server and I now have someone who wants it in a subdir. I've changed the base url in the htaccess and I've tried manually changing references in the CSS and DB but I can't be sure I've caught everything (modules etc).
What I want to know is, is there a way to force every link relative to the root to be relative to root/example instead. Basically everything that was once at www.example.com is now at www.example.com/subdirectory.
Thanks.
There's two pieces to this. The first you've already done: configuring htaccess to set a base url that includes the subdirectory.
Unfortunately, you may have quite a few references in the node content (especially embedded images) that will stop working.
A relatively simple solution to this would be to include a <base href="foo.com/dir" /> tag in your site theme, but this isn't a great fix in the long term.
You can try modifying your database directly, through queries such as the following (use with care, backup your database ahead of time, etc):
UPDATE field_revision_body SET body_value = REPLACE(body_value, 'devdomain.com', 'proddomain.com/subdir') (add http:// into those queries)
You may also need to update the paths in your files table to reflect the new locations on disk, especially if you're using multisite.
Alternately, have you considered using the Backup & Migrate module to move content from the dev server to a new install at the new instance?

Limit IIS virtual Directories pointing to same folder path

I have an asp.net project that I use for a couple different purposes. We have addresses that access the same virtual directory via different paths (use1.company.com and use2.company.com) I do not want to break the project up as they use similar functionality that seems redundant to have in two places. None the less as it stands use1.company.com/default.aspx and use2.company.com/default.aspx both are the same. I want to make it so that use2.company.aspx/default.aspx is not accessible. Is there a way to do that from the App Pool/Virtual Directory settings or do I just have to hope that external users dont type /default.aspx?
I know I can set the default document to like survey.aspx (purpose of the second url) but that does not prevent some savvy users from typing in default.aspx just to see what it does. Any assistance here would be great.
Since they point to the same .aspx file could you not include an if statement at the start of the file to grab the URL and if it includes use2 then go back?

Coldfusion security issue...how to hide directory of files?

So, I decided to try to break my website...I googled my site by typing in site:mysite.com/whatever and behold, all of the users uploaded files were available for view under a specific directory.
What kind of script/ counter measure should I use to block these files from being viewed? I already have a script that checks the path and the logged in status, however this doesn't seem to be working. I've looked all over for solutions...but I can't quite find one. I'm using ColdFusion 8.
This isn't a ColdFusion issue so much as a web server configuration issue.
You should either:
configure your web server not to show a directory of files when using a URL without a filename (e.g., http://www.example.com/files/)
drop a blank default web document (index.html, index.htm, default.htm, index.cfm, whatever) into that directory so that it displays that document rather than the list of files. If you use index.cfm, it'll fire your Application.cfm/cfc in your file path and use whatever other security you've built.
(or, better, do both)
The best way to secure your file listings and the files themselves is to store them in another folder outside of the Web site root folder. You can then serve them up using CFDIRECTORY and CFCONTENT. The pages that display the files can check your access controls and only serve the files to those allowed to see them.

Moving new folder to root

I have created a new website for a client, (joomla) which is currently running within a folder in the root called /new/ (original I know)
I am now trying to work out what would be the best way to switch over the sites, there are a lot of files (pdf's, doc's etc) so moving everything would take some time, plus the old site is very messy, and would also take some time to remove in one go.
What about htaccess, and having a redirect? I could then remove the old site and files from the root over time?
One approach could be the use of symbolic links(ln -s basically), but you won't be able to do that for files that have the same name in both root and your new/ subdirectory. You will encounter this same issue with apache redirects, thus basically, you need to decide before hand what do you want to serve from either root or new/ and resolve the possible conflicts.

Resources