Menu
Home
Advertise
Forums
Search forums
What's new
Unread posts
New articles
New article comments
Latest activity
Earn Money
Money apps
Passive Income
Paid Survey
Forex
Stock
Real estate
Paid to write
Social Media Earning
Review Website/Apps
Crytocurrency
Bitcoin (BTC)
Ethereum (ETH)
Crypto Exchange
Mining
Crypto Faucet / Airdrops
Binance
Business
Business strategy
Funding a business
Marketing
Digital Marketing
Social media marketing
Email marketing
Brand management
Personal Finance
Money Saving
Retirement
Personal loan
Savings for Students
Debt help
Tax relief
Insurance
Car Insurance
Life Insurance
Liability Insurance
Home Insurance
Health Insurance
Disability Insurance
FAQ
Log in
Register
What's new
Search
Search
Search titles only
By:
Search forums
Menu
Log in
Register
Install the app
Install
Home
Forums
Webmaster forum
Webmaster
Which is better Subdomain or Subfolder?
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
You are using an out of date browser. It may not display this or other websites correctly.
You should upgrade or use an
alternative browser
.
Reply to thread
Message
[QUOTE="onesteptosucces, post: 63143"] Many people want WordPress to power their website’s root (e.g. [URL="http://example.com"]Example Domain[/URL]) but they don’t want all of the WordPress files cluttering up their root directory. WordPress allows you to install it into a subdirectory, but have your website served from the website root. As of Version 3.5, Multisite users may use all of the functionality listed below. If you are running a version of WordPress older than 3.5, please update before installing a Multisite WordPress install on a subdirectory. Note to theme/plugin developers: this will not separate your code from WordPress. Themes and plugins will still reside under wp-content folder. Moving a Root install to its own directory #Moving a Root install to its own directory Let’s say you’ve installed wordpress at example.com. Now you have two different methods to move wordpress installations into subdirectory: 1) Without change of SITE-URL (remains example.com) 2) With change in SITE-URL (it will redirect to example.com/subdirectory) Top ↑ Method I (Without URL change) #Method I (Without URL change) 1) After Installing the wordpress in root folder, move EVERYTHING from root folder into subdirectory. 2) Create a .htaccess file in root folder, and put this content inside (just change example.com and my_subdir): <IfModule mod_rewrite.c> RewriteEngine on RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteCond %{REQUEST_URI} !^/my_subdir/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^(.*)$ /my_subdir/$1 RewriteCond %{HTTP_HOST} ^(www.)?example.com$ RewriteRule ^(/)?$ my_subdir/index.php [L] </IfModule> That’s all ? Top ↑ Method II (With URL change) #Method II (With URL change) Moving process #Moving process (p.s. If you’ve already installed WP in subdirectory, some steps might be already done automatically). Create the new location for the core WordPress files to be stored (we will use /wordpress in our examples). (On linux, use mkdir wordpress from your www directory. You’ll probably want to use chown apache:apache on the wordpress directory you created.) Go to the General Screen. In WordPress address (URL): set the address of your main WordPress core files. Example: [URL]http://example.com/wordpress[/URL] In Site address (URL): set root directory’s URL. Example: [URL="http://example.com"]Example Domain[/URL] Click Save Changes. (Do not worry about the errors that happen now! Continue reading) Now move your WordPress core files (from root directory) to the subdirectory. Copy (NOT MOVE!) the index.php and .htaccess files from the WordPress directory into the root directory of your site (Blog address). 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. For the index.php file the instructions remain the same, copy (don’t move) the index.php file to your root directory. The web.config file, must be treated differently than the .htaccess file so you must MOVE (DON’T COPY) the web.config file to your root directory. Open your root directory’s index.php file in a text editor Change the following and save the file. Change the line that says:require( dirname( [B]FILE[/B] ) . '/wp-blog-header.php' );to the following, using your directory name for the WordPress core files:require( dirname( [B]FILE[/B] ) . '/wordpress/wp-blog-header.php' ); Login to the new location. It might now be [URL]http://example.com/wordpress/wp-admin/[/URL] If you have set up Permalinks, go to the Permalinks Screen 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.) [/QUOTE]
Insert quotes…
Verification
Post reply
Home
Forums
Webmaster forum
Webmaster
Which is better Subdomain or Subfolder?
Top