Default Green Orange
grzegorz brzezinka.eu
Be curious. Laugh a lot.
    Home Page Home
  • Contact
RSS

Posts Tagged ‘hosting’

Redirect page through .htaccess

webmaster tips 0 Comment »

Some time ago I have changed my hosting provider. I’ve turned to http://www.site5.com as my old provider http://www.nazwa.pl lacked of several useful options.

As a consequence, I had to move several websites to a new server… You know, a nightmare changing configuration files in different CMSes…

I have faced the following problem: some of the websites were stored in subfolders (subdomains), let’s say /blog (http://www.mydomain.com/blog). After the change, we want to have the website available under the main domain http://www.mydomain.com. How to do it?

Well, the answer seems to be quite simple: copy all files to your main directory and… sadly some elements are not working. Why? It turned out that some elements references still targeted to elements in /blog. There are two solutions:

  1. Manually change the path of each element (ex. using find&replace). But if you have thousends of files + entries in database… This may drive you crazy after a while, you can imagine. Far  better solution is:
  2. Create/modify the .htaccess file in the /blog directory:
    Redirect /blog http://www.mydomain.com

That’s it :-) The latter applies also if you want to redirect a subdomain to another web address.


Marzec 7th, 2010  
Tags: .htaccess, domain, hosting, tips&tricks, webmastering



  • Newest posts

    • Export to Excel (xls) in Rails3
    • Linux: how to renew DHCP IP address?
    • Full page background image in Prawn PDF in Rails3
    • Github error – fatal: Unable to look up github.com (port 9418) (Name or service not known)
    • RubyGems warning/error: Gem::Specification# default_executable = is deprecated with no replacement. It will be removed on or after 2011-10-01.
  • Tags

    human body eye hosting domain movie image google brain gym Math .htaccess wordpress science riddle Joomla webmastering fun Rails3 jQuery Ruby on Rails tips&tricks
  • In the blog you’ll find:

    • Funny (3)
      • Riddles (2)
    • interesting facts (1)
    • linux (1)
    • Projects (1)
    • science (5)
      • computer (1)
      • human body (1)
      • Math (1)
      • physics (1)
    • Uncategorized (2)
    • webmaster tips (23)
      • Joomla (2)
      • jQuery (6)
      • Rails3 (5)
      • Ruby (11)
      • WordPress (1)
  • Translate!

      Translate to:

      Powered by Google Translate.
Copyright © 2012 grzegorz brzezinka.eu All Rights Reserved
XHTML CSS Zaloguj się
Designed by iSoftware Reviews and