We had the following problem with redirecting a subdomain and this is the solution:

Initial status: The main domain is www.cactus-competence.com. It is Wordpress based.

Within our Site we had a submenu named "books" which linked to a url named www.cactus-competence.com/books.

With this setup everything worked fine.

We set up a new subdomain and called it books.cactus-competence.com.

At this instant our initial menu "books" was no longer reachable and we got a 403 Permission denied error.

What happened?

When creating the subdomain a new folder (the document root) for the subdomain was created named "books". And now our menu item "books" and its url www.cactus-competence.com/books tried to access this folder instead of opening the page as it did before. As we had made a redirection to the menu url at the same time that we created the subdomain we thought it was a redirection problem, what was in fact not the case.

Solution:

The solution was to rename the document root created by the subdomain to "buecher" instead of "books" and deleted the initial folder "books". Now everything was fine again.

Alternatively, if you would like for WordPress to ignore a specific physical directory that you have created, this can be done in your .htaccess file.

If your physical folder was called books, you would add this rule into your default WordPress rewrite rules:

RewriteCond %{REQUEST_URI} books/ [OR]

 

This would need to be placed above the lines checking for an existing file !-f or directory !-d 

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /wordpress/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} books/ [OR]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /wordpress/index.php [L]
</IfModule>
# END WordPress

 

Tip for the future:

Always rename the document root created by the subdomain into something the you would never use as a menu item. Suggestion: Use the name of the subdomain and add the creation date.

Post a Comment

Name:
Email Address:
Phone Number:
Comment:
Submit

Please note: Your name and comment will be displayed, but we will not show your email address.

News / Announcements

WordPress wp-login.php brute force attack
Updated 2014-07-17 06:43 pm EST
Hits: 200893

Need more Help?

Search

Ask the Community!

Get help with your questions from our community of like-minded hosting users and InMotion Hosting Staff.

Current Customers

Chat: Click to Chat Now E-mail: support@InMotionHosting.com
Call: 888-321-HOST (4678) Ticket: Submit a Support Ticket

Not a Customer?

Get web hosting from a company that is here to help. Sign up today!