(.htaccess) Mapping Multiple Domains to a different folders

Imagine if your have multiple domains with multiple sub folders and you’re using the root directory (public_html) as your main domain. Isn’t messy?

Try this tricks using your .htaccess.

  1. In root (public_html) directory, create a folders folder1 and folder2.
  2. Create .htaccess  in your public_html  directory.
  3. Paste the following rules and modify accordingly.
<IfModule mod_rewrite.c>
RewriteEngine On

# pointing domain1.com to folder1
ReWriteCond %{HTTP_HOST} domain1.com
ReWriteCond %{REQUEST_URI} !folder1/
ReWriteRule ^(.*)$ folder1/$1 [L]

# pointing domain2.com to folder2
#ReWriteCond %{HTTP_HOST} domain2.com
#ReWriteCond %{REQUEST_URI} !folder2/
#ReWriteRule ^(.*)$ folder2/$1 [L]


Note: If you have working sub domains, you might need to manually point them to your index file by creating .htaccess inside your sub domain directory. If you have existing .htaccess then add this line:

RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]



WordPress – Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted

Trying to access your wordpress administrator dashboard but receiving this error?

Fatal Error: Allowed Memory Size of 134217728 Bytes Exhausted

If you’re just on a shared hosting services, you probably don’t have an access to your php.ini. If so, do it this way through your .htaccess

add this line to your htaccess:

php_value memory_limit 512M

That’s it then hit Save!

If that doesn’t work, you may wish to try alternate values for the memory limit depends on what you need:  8, 12, 16, 32, 64, 128, 512 ...etc.