• Hello,

    I have a word press blog at abc.domain.com , when I point this it works fine, but if I point to domain.com/abc the pages loads without contents(page not found error- no blogs displayed). I found this error due to error logs in cpanel as some search engines redirect to domain.com/abc/(content).

Viewing 3 replies - 1 through 3 (of 3 total)
  • It is not going to work when pointing to domain.com/abc because of the way that WordPress does redirection. Your best bet is come up with some mod_rewrite redirection code to place in your top level .htaccess file that rewrites the URL of all traffic coming in for domain.com/abc to abc.domain.com. Then you don’t need WordPress to work under two sets of URL’s.

    Thread Starter skullz

    (@skullz)

    Can you explain in detail how to do that?
    Thanks.

    see if this article helps

    http://terriswallow.com/weblog/2008/htaccess-redirect-a-directory-to-a-subdomain-and-force-www/

    translating its code to your example, you should have

    Options -Indexes +FollowSymLinks
    
    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^domain.com [NC]
    RewriteRule ^(.*)$ http://www.domain.com$1 [L,R=301]
    
    RedirectMatch 301 ^/blog/(.*)$ http://blog.domain.com/$1

    place the code in your .htaccess file before the code that WordPress added to the .htaccess file

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Folder to Subdomain- File not found error’ is closed to new replies.