WordPress.org

Ready to get started?Download WordPress

Forums

Writing a URL redirect for my blog (3 posts)

  1. Strictly Software
    Member
    Posted 3 years ago #

    I have a wordpress site with a number of sub domains set up e.g

    my main site is http://www.mysite.com and I also have search.mysite.com
    and blog.mysite.com. At the moment all the subdomains just point to my main site.

    I have a category set up on my blog that contains articles purely written by myself and they are currently accessed from the category URL http://www.mysite.com/myarticles.

    What I want to do is add a rewrite rule to my htacess file so that
    blog.mysite.com points to http://www.mysite.com/myarticles and the user believes they are on a different sub domain even though its just a pointer to a category on my site.

    I can do a Redirect rule at the moment with

    RewriteCond %{HTTP_HOST} ^(blog\.)?mysite\.com
    RewriteRule ^(blog\.)?mysite\.com/?$ /myarticles/ [NC,L]

    and

    RewriteCond %{HTTP_HOST} ^(blog\.)?mysite\.com
    RewriteRule ^(blog\.)?mysite\.com/?$ /myarticles/ [R=permanent,L,NC]

    but they just point to my main site http://www.mysite.com with that URL in the address bar

    and

    RewriteCond %{HTTP_HOST} ^(blog\.)?mysite\.com
    RewriteRule ^(.*)$ /myarticles/ [L,NC]

    gives a 500 status code redirect loop error

    and

    RewriteCond %{HTTP_HOST} ^(blog\.)?mysite\.com
    RewriteRule ^(.*)$ http://www.mysite.com/myarticles/ [R=permanent,L,NC]

    Takes me to the right page but shows http://www.mysite/myarticles in the address bar and not blog.mysite.com which is what I want.

    I dont want to set up separate folders on my webserver with virtual domains etc if possible as the content is all going to run off the same database and wordpress folder.

    Can anyone help me with the htacess rewrite rules that I will need to mask my category URL with my blog subdomain. I want to be able to use blog.mysite.com as my links.

    Any help would be much appreciated.,

    Thanks

  2. Jonas Grumby
    Member
    Posted 3 years ago #

    Log into your hosting control panel. There is usually a GUI-driven way to set these things up there.

  3. Strictly Software
    Member
    Posted 2 years ago #

    Sorry what kind of application am I looking for?

    I am capable of writing my own htaccess rules so I would have thought editing the file would have done this but obviously not.

    Could you be more specific to the sort of app you are talking about.

    I am on a LINUX box with APACHE and use VirtualMin to manage my server.

    Thanks for your help

Topic Closed

This topic has been closed to new replies.

About this Topic