Single Wordpress site in subfolder/subfolder - wordpress

I have a wordpress site that needs to work in a subdirectory : domain.com/dir/subdir/. It's a copy of a site that is in a single subdirectory – domain.com/subdirectory.
The database connection is working fine (content is there) but script urls etc are domain.com/wp-content and not the subdirectory.
Here's what I've tried:
- updating home and site url in options table
- different setups in .htaccess setting RewriteBase to /folder/subdir/ (gives me server error)
- setting site url manually in index.php
Any ideas how to solve this?

Related

OpenLiteSpeed WordPress VPS 404 Error on Non-Wordpress Site Install in Sub Folder

I have an OpenLiteSpeed VPS WordPress install over at Vultr, and am trying to install a non-WordPress website into a sub-folder I created.
Ex.) https://example.com/test that is pointed to a new folder I created in the WordPress root install directory of /var/www/html/test
I created the directory and placed the files needed there that include an index.php file, however when I go to https://example.com/test, I receive a 404 Not Found error. I believe it has something to do with modifying the .htaccess file in the root of my WordPress install, but am unsure of what to modify 100%.
Any help is appreciated!
I tried modifying the Rewrite rules but am not confident in the options I chose. I since reverted the .htaccess file back to my default settings in which OpenLiteSpeed defines.
This can be closed out - I have it defined in my index.php file that resides in that folder point to a database I created in phpMyAdmin and I had the database field filled out incorrectly. Thank you to everyone who replied though. Oops!

Using wordpress in a subdirectory

I use to have wordpress installed on the root of the website, but today I moved to a subdirectory "root/blog" with these steps:
1) Moved all the files>
2) Copied .htaccess and index.php do "root" and modify them
3) Change the wordpress URL on the settings.
It worked fine.
But I don't want it be accessed via www.mysite.com. I want to be access as www.mysite.com/blog. I want to do my own main index.
But if I remove the index.php from root, it gives me problems like /blog won't find my static first page.
What I'm missing?
You need to change your apache virtualhosts settings.
More infos here.

Migrate wordpress site from subfolder to root, remove static page

My website have structure like this:
In root domain I have static html page "portfolio" (which I won't need it anymore, becauose I'll create it in wordpress):
http://www.natasamedvesek.com/
and I have installed wordpress for blog in subdirectory:
"natasamedvesek.com/blog/"
Now I have also all my pages structured like this "/blog/about" , "/blog/info" .... .
Now I'm asking what to do:
(1) move wordpress instalation from subdirectory "blog" to root directory.
or
(1) leave wordpress instalation as it is, in subdirectory "blog" and create redirect 301
My new structure would look like this:
"natasamedvesek.com" ---> portfolio "natasamedvesek.com/about" ---->
page "about" "natasamedvesek.com/info" ----> page "info" . . .
"natasamedvesek.com/blog/" ---> page of postsIt's very important that I won't lost all my existing likes and shares from facebook, from all of my posts? What about my existing rank for SEO on google?
If I do create redirect 301, what I have to do?
Is this correct way, if I would put this code in .htaccess file
#Options +FollowSymLinks
RewriteEngine on
RewriteRule ^(.*)$ http://www.natasamedvesek.COM/$1 [R=301,L]
Thanks for answers
It's much easier than using redirects; you can use the pre-existing subdirectory install and have admin at /blog/ while root appears to be at root.
From Giving WordPress Its Own Directory « Using a pre-existing subdirectory install
1) Go to the General panel.
2) In the box for Site address (URL): change the address to the root directory's URL http://www.natasamedvesek.com
3) Click Save Changes. (Do not worry about the error message and do not try to see your site at this point).
4) Copy (NOT MOVE!) the index.php and .htaccess files from the blog directory into the root directory of your site.
5) Edit your root directory's index.php. Open your root directory's index.php file in a text editor. Change the line that says:
require( dirname( __FILE__ ) . '/wp-blog-header.php' );
to the following, using your directory name for the WordPress core files:
require( dirname( __FILE__ ) . '/blog/wp-blog-header.php' );
and save the file.
6) Login to your site (if you aren't still already). The admin URL should still be http://www.natasamedvesek.com/blog/wp-admin/
7) If you have set up Permalinks, go to the Permalinks panel and update your Permalink structure. WordPress will automatically update your .htaccess file if it has the appropriate file permissions. If WordPress can't write to your .htaccess file, it will display the new rewrite rules to you, which you should manually copy into your .htaccess file (in the same directory as the main index.php file.)
very important that I won't lost all my existing likes and shares from
facebook...
You will lose your Facebook shares because the URL is changing, and there is no way to change an incoming Facebook link. And your SEO will take a temporary hit because you are changing URLs, at least until Google reindexes the site.

magento under wordpress as subdirectory not working

I am using godaddy server.
I have wordpress as root directory and i have setup magento from local to server inside root as subdirectory.
Magento home page is working fine,but when i try to open any supage of magento then it opens "About us" page without CSS of root wordpress.
Thanks in advance.
Have you set the RewriteBase statement in Magento .htaccess ?
#RewriteBase /magento/
become
RewriteBase /subdirectory/
If your server is configured correctly you don't need to set RewriteBase, but make sure your base url is set correctly in backend as {server-root}/subdirectory/. If you cannot access admin, you'll need to change data in core_config_data by searching fields by url and setting the correct value by for example phpMyAdmin. Otherwise you'll need to do it by ssh + mysql command... or reinstall your Magento instance giving correct url to the installer.

TYPO3 and CDN setup

I am trying to figure out how to setup CDN for a TYPO3 website and I have some
questions regarding it.
I have created 3 subdomains:
cdn.domain.com - typo3temp
cdn1.domain.com - fileadmin
cdn2.domain.com - typo3conf
Do I need to move/copy the folders from the root folder on domain.com to the httpdocs on each of these subdomains or will TYPO3 fetch the static content from the root directory
on domain.com and how to do it?
I am trying to use it with ja_replacer and httpconnection - none of them seems to work, so I am doing something completely wrong.
I got it it solved by symlinking it directory to the subdomain to be used and the ja_replacer to replace all path in the FE ouput and it works perfectly.

Resources