Forum Moderators: phranque

Message Too Old, No Replies

Root domain affecting subdomain

Newbie here.. any help will be greatly appreciated

         

Fernando

10:07 pm on Aug 14, 2007 (gmt 0)

10+ Year Member



Hi all,
I have read a similar message string but I am very new to this and didn't understand a word of it so I am posting it as a new message (sorry if it is a duplicate).
I have two blogs hosted by wordpress:
www.example.com
www.example.com/turkce
I have changed my permalink structure for .com and updated the .htaccess file accordingly. I tried to do the same for .com/turkce but it doesn't work because the root domain rewrite rule affects the rewrite rule for the subdomain.
Here is what I added to my htaccess file for .com:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
When I add the similar for .com/turkce underneath, it doesn't work, all post titles for .com/turkce get directed to post titles of .com.
Should I create and add another htaccess file for the subdomain? Or add a code inside the above rule? If so, should I add the rewrite rule for .com/turkce underneath afterwards?
Please help!
Many thanks in advance!

[edited by: jdMorgan at 12:44 am (utc) on Aug. 15, 2007]
[edit reason] example.com [/edit]

jdMorgan

4:13 pm on Aug 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It isn't clear if these two blogs are on two domains sharing one hosting account, or if the second blog is simply located in a subdirectory, and both blogs share the same domain.

However, you can do one of two things:

Add a RewriteCond testing %{HTTP_HOST} (or testing %{REQUEST_URI} for requests to the second blog's subdirectory, as applicable) to your main blog's rules so that they will only be applied for the main blog, followed by a similar rewriterule-set for the subdirectory-blog, or

Put the directive

 RewriteOptions none 

in the .htaccess file for the blog in the subdirectory. This will disable processing of your homepage-directory .htaccess file for requests made to this subdirectory.

Jim

Fernando

10:23 pm on Aug 15, 2007 (gmt 0)

10+ Year Member



Jim - Thanks for responding. I am sorry for not being clear. Maybe I used the wrong term by calling the second blog a subdomain... They are sharing the same hosting. When I log into my cpanel, there is a file under public html called turkce for my domain www.example.com/turkce. It does not have a htaccess file on its own. There is a single htaccess file and I tried to add rewrie rules for /turkce within that file.
So should I create a new htaccess file for /turkce? And can you be more specific? I am sorry but when you say as applicable I can not understand what you are referring to. It would be great if you can tell me like: put the following code at this location...
I hope I am not a headache.
*************************
It isn't clear if these two blogs are on two domains sharing one hosting account, or if the second blog is simply located in a subdirectory, and both blogs share the same domain.

However, you can do one of two things:

Add a RewriteCond testing %{HTTP_HOST} (or testing %{REQUEST_URI} for requests to the second blog's subdirectory, as applicable) to your main blog's rules so that they will only be applied for the main blog, followed by a similar rewriterule-set for the subdirectory-blog, or

Put the directive
RewriteOptions none
in the .htaccess file for the blog in the subdirectory. This will disable processing of your homepage-directory .htaccess file for requests made to this subdirectory.

Jim

[edited by: jdMorgan at 3:06 am (utc) on Aug. 16, 2007]
[edit reason] example.com [/edit]