DISQUS

ace's blog: Moved my blog to new domain

  • Owen · 3 years ago
    Hi ace,

    I am just wondering if you can share with me your entire .htaccess file and the corresponding httpd.conf settings?

    I recently moved my site from http://oblong.gotdns.org (a crappy DynDNS account) to http://owened.net -- my .htaccess file looks like so -- do you have any idea why its not working, the way it is? (save for the commented-out-until-its-working-properly lines)

    Thank-you.
  • petewood · 3 years ago
    Owen,
    I found the .htaccess file I have online. I must've looked at about 30 or 40 results of a google search until I figured out what was wrong with my htaccess file. Below is my entire .htaccess file on my old subdomain:

    RewriteEngine On

    RewriteCond %{HTTP_HOST} ^blog\.petewood\.us
    RewriteRule ^(.*)$ http://www.acedanger.com/$1 [r=301]

    Beyond showing you what I have, I am afraid that I can't be of any help figuring out why your file is not working just by looking at it. What is happening when you uncomment the commented lines?
  • Owen · 3 years ago
    At present, the rules are:

    RewriteCond %{HTTP_HOST} !^owened\.net$
    RewriteRule ^(.*)$ http://owened.net/ [R,L]


    Which from my understanding means, "if the requested URL is not 'owened.net', then redirect the browser to 'owened.net' -- which works OK, except if for example someone were to browse to a page like http://oblong.gotdns.org/windowsxp-to-ubuntu-60..., they would simply be redirected to just owened.net.

    So now, my .htaccess looks like this:

    RewriteCond %{HTTP_HOST} ^oblong\.gotdns\.org$
    RewriteCond %{HTTP_HOST} ^www\.owened\.net$
    RewriteRule ^(.*)$ http://owened.net/$1 [R=301]


    Which says "if the requested URL is oblong.gotdns.org or www.owened.net, redirect the browser to owened.net" -- I think. The $ at the end of the RewriteCond lines means "remember what goes here", and the $1 at the end of the RewriteRule means "put what you remembered here", as far as I know...

    So, I've got no idea why it isnt working. :(
  • petewood · 3 years ago
    Owen, Try commenting out the second Rewrite Cond (RewriteCond %{HTTP_HOST} ^www\.owened\.net$). That appears to be the only thing that is different from my file and yours.
  • Owen · 3 years ago
    Hi ace,

    It's been a while, but I finally got things working for me. Following are the relevant lines from my .htaccess:

    RewriteEngine On
    RewriteBase /
    RewriteCond %{HTTP_HOST} ^oblong\.gotdns.org$ [OR]
    RewriteCond %{HTTP_HOST} ^www\.owened.net$ [NC]
    RewriteRule ^(.*)$ http://owened.net/$1 [L,R=301]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ http://owened.net/index.php/$1 [L]


    Some of them you will recognise from Wordpress' rules. The three important ones are lines 3, 4 and 8 -- a mate of mine helped me out, and we figured this.

    Anyway, just letting you know, and thanks again for your assistance. :-)