SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Apr 2004
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Map a page to a subdomain in wordpress

    I'm trying to map a specific page to a subdomain in wordpress.

    For example, I have this wordpress page: www.mysite.com/mypage

    I want that when someone enters mypage.mysite.com the content of www.mysite.com/mypage shows (not with a redirect).

    Can't find a way to do this.

    I've already tried with Rewrite rules in .htaccess file with no luck.

    I tried something like this:

    #RewriteCond %{HTTP_HOST} mypage.mysite.com
    #RewriteRule ^(.*)$ http://mysite.com/mypage$1 [R=301,L]

    But this redirects instead of invisible showing the content of the page.

    Is this possible to achieve with a subdomain?

    Many thanks.

  2. #2
    SitePoint Wizard
    Join Date
    Oct 2005
    Posts
    1,763
    Mentioned
    5 Post(s)
    Tagged
    1 Thread(s)
    Quote Originally Posted by DeLaVega View Post
    I tried something like this:

    #RewriteCond %{HTTP_HOST} mypage.mysite.com
    #RewriteRule ^(.*)$ http://mysite.com/mypage$1 [R=301,L]

    But this redirects instead of invisible showing the content of the page.
    You have a R=301 flag issuing a redirect. Did you try that without the R=301 flag?

    I'm not sure if what you want to do is possible because Wordpress itself does its own rewriting. I know you can rewrite a subdomain request to a PHP script as some do with wildcard subdomains. Try getting rid of the "R=301," part and see how that works first.

  3. #3
    SitePoint Addict
    Join Date
    Apr 2004
    Posts
    263
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by cheesedude View Post
    You have a R=301 flag issuing a redirect. Did you try that without the R=301 flag?

    I'm not sure if what you want to do is possible because Wordpress itself does its own rewriting. I know you can rewrite a subdomain request to a PHP script as some do with wildcard subdomains. Try getting rid of the "R=301," part and see how that works first.
    Yes, I have tried with and without the R=301.

    I have a plugin that converts all categories to subdomains automatically, but can't manage to use some pages as subdomains.

    Thanks.


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •