Using wordpress in a subdirectory - wordpress

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.

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!

Add custom name to base url on WordPress

How can I add to my domain a custom name, as for example:
mydomain.com/test/
So if visit any page or post the URL will be
mydomain.com/test/...
Simplest method is to install Wordpress in a directory called /test/ relative to you webserver root.
For example, if your webserver root is /var/www/ then you can install it in /var/www/test/.
Then all of your WordPress URLs will begin with mydomain.com/test/
Alternatively, you can add rewrite rules to your webserver configuration, but that gets more complicated.

How to redirect wordpress (installed inner directory) to main root address?

I've installed wordpress into a inner directory. like root/mysite . Why I didn't install it on root because there are so many addon domain installed, and I literally don't want to mess all addon domain folders with wordpress files inside root directory. My root directory is for www.example.com . And my wordpress site I've installed on root/mysite, so the url for that is www.example.com/mysites . Is there anyway to redirect www.example.com/mysites to www.example.com . As I said the only reason for not installing wordpress on my root, because I don't want to mess wordpress files, folders with other addon domain's folders on root.
So my main goal is showing a wordpress site on www.jimfahad.com that is installed on www.example.com/mysites. Is there any way?
Yes, you can leave the WordPress install and folders in mysites, but you have to copy the .htaccessfile and the index.php file to root. This will result in the visual URL of WordPress being in root (example.com), but the uploads, theme URLs, etc, being in example.com/mysites.
See the WordPress Codex > Giving WordPress Its Own Directory « Using a pre-existing subdirectory install on how to copy and edit the files:
1) Go to the General settings panel.
2) In the box for Site address (URL): change the address to the root
directory's URL. Example: http://example.com
3) Click Save Changes. (Do not worry about the error message and do
not try to see your blog at this point! You will probably get a
message about file not found.)
4) Copy (NOT MOVE!) the index.php and .htaccess files from the
WordPress (wordpress in our example) directory into the root directory
of your site—the latter is probably named something like www or
public_html. The .htaccess file is invisible, so you may have to set
your FTP client to show hidden files. If you are not using pretty
permalinks, then you may not have a .htaccess file. If you are running
WordPress on a Windows (IIS) server and are using pretty permalinks,
you'll have a web.config rather than a .htaccess file in your
WordPress directory.
5) Edit your root directory's index.php:
6) 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__ ) . '/wordpress/wp-blog-header.php' );
and save the file.
7) Login to your site (if you aren't still already). The URL should
still be http://example.com/wordpress/wp-admin/
8) 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.)

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.

Bitnami Stack : accessing wordpress installation in its own directory at domain root

Please Bear With Me!!
i am using this tutorial Giving Wordpress Its Own Directory (Using a pre-existing subdirectory install part ) to launch a wordpress (installed at a sub folder called wordpress) by using example.com instead of example.com/wordpress.
Now it says that copy index.php to your root folder and change the relative path to wp-blog-header.php accordingly now by folder structure is a little complex hence i have attached a pic
Now to access site root i go to example.com(obvious)
but to access wordpress i have to go to example.com/wordpress (if anyone wondering why i am using bitnami wordpress stack AMI and thus everything came preconfigured)
now accoringly to tutorial i should copy index.php to site root from wordpress root and change relative location of wp-blog-header.php accordingly.
when index.php was in same directory the function was require('./wp-blog-header.php') . Now this location is to be changed
I have tried all three options i could think of (i guess)
1) ../apps/wordpress/htdocs/wp-blog-header.php
2)./wordpress/htdocs/wp-blog-header.php
3)wordpress/htdocs/wp-blog-header.php
Edit : its a bitmani wordpress stack ami on amazon aws and its the reason i believe there is problem in the first place.
But visiting the domain root gives server error . Any suggesstions??
Try require ( $_SERVER['DOCUMENT_ROOT'] . '/wherever/wp-blog-header.php/is/located and it should find it.
Here is the answer http://wiki.bitnami.org/Components/Apache#How_to_change_the_URL.3f
it was because of bitnami and not a fault of wordpress

Resources