Moving wordpress from TLD to sub-folder (URL structure only)

My recommendation is to use one WP installation and to simply add /blog/ to your permalink structure. This will give all of your blog posts a mytld.com/blog/postname format and pages will not pickup the /blog/ prefix. Adjust Permalink settings at Settings > Permalinks and select the Custom Structure radio button. Enter /blog/%postname%/ in the field … Read more

Multi site root site installed on subdomain, with child sites as subdirectories

It’s likely because your authentication cookie is set to dev.example.com/site1/ when you login to site1, and naturally the browser won’t pass that cookie for site2. What you can try and do is play around with the SITECOOKIEPATH and ADMIN_COOKIE_PATH, which by default are set as follows: SITECOOKIEPATH to get_option(‘siteurl’) ADMIN_COOKIE_PATH as SITECOOKIEPATH . ‘wp-admin’ So … Read more

Can I have a php site on subdirectory of WordPress?

Technically, it’s possible. And it works. You could have a PHP site on a sub-directory like example.com/shop. But, a better practice is to host that PHP site on a sub-domain like shop.example.com. It helps in better maintenance and provides a better structure for organizing the site. On a Nginx server, your config should be something … Read more

Correct Syntax for uploading files to custom directory in WordPress

(Update to answer: 05.27.15) What finally worked is using ABSPATH: $folderPath = “/jobtracking/files/standard/{$projID}”; mkdir(ABSPATH.$folderPath, 0755, true); $filename = basename($_FILES[‘Attach_Files’][‘name’]); $filetype = $_FILES[‘Attach_Files’][‘type’]; $datei = “files/standard/{$projID}/{$filename}”; $target_path = ABSPATH.$folderPath . “https://wordpress.stackexchange.com/” . $filename; if(move_uploaded_file($_FILES[‘Attach_Files’][‘tmp_name’], $target_path)) { mysql_query(“INSERT INTO files (files.name, files.project, files.user, files.added, files.datei, files.type, files.folder, files.visible) VALUES(‘{$filename}’, ‘{$projID}’, 5, UNIX_TIMESTAMP(now()), ‘{$datei}’, ‘{$filetype}’, 0, ‘ ‘)”); … Read more