WordPress.org

Forums

Redirects from subdomains (1 post)

  1. wesg
    Member
    Posted 7 years ago #

    Basically I"m trying to create a mobile version of my blog. I have the main domain with the WordPress main install, but then my subdomain also links to that data with its own theme.

    I've run into a problem where the main domain redirects fine, but the permalinks on the subdomain always redirect to sub.domain.com/index.php. When I use basic permalinks it redirects properly, but that's not how my blog works.

    How can I do both at once? Here are the .htaccess files used by my site.

    Main domain
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{HTTP_USER_AGENT} (.*iPod.*¦.*iPhone.*) [NC]
    RewriteRule ^(.*) http://sub.example.com/$1? [R=301,L]
    </IfModule>

    Subdomain
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.