Forum Moderators: phranque

Message Too Old, No Replies

server migration with permalinks enabled

permalink server problems

         

milo317

1:23 pm on Dec 3, 2007 (gmt 0)

10+ Year Member



Hi all,

moving to a new host from yahoo servers with three subdomains,
currently the subdomains can be accessed via two urls:
domain.com/sub/
and
sub.domian.com

how to achieve the same result or prevent that on the new server
(permalinks are enabled and working)?

thnks

gergoe

12:27 am on Dec 4, 2007 (gmt 0)

10+ Year Member



Probably you could find answers to similar questions on this forum, but here are few hints;
  • You will certainly need four virtualhosts (servers, hosts, whatever it is called), one for the main site, three for the subdomains;
  • If you want to make visitors go to sub1.domain.com from www.domain.com/sub1 automatically (that's you want to prevent the use of directories), then you will need a .htaccess file in each three subdirectory, which will redirect the visitor to the subdomain if the current request is not for the subdomain yet.
    Take a look in the Apache documentation: Apache Tutorial: .htaccess files [httpd.apache.org] and
    URL Rewriting Guide->Canonical Hostnames [httpd.apache.org]
  • The RewriteRule directive in the .htaccess files has a slightly different behavior, while in the httpd.conf RewriteRule ^/test/$ matches the test subdirectory, but in a .htaccess file placed in the test subdirectory, the same can be achieved by RewriteRule ^$, because the path is always stripped off.