Redirect 301


#1

Hi. I’m trying to set up 301 redirects that will redirect from a Movable Type blog to a WordPress blog. I’ve searched the web, and looked at earlier threads here, but I’ve been unable to get anything to work. Here is exactly what I would like to do.

The actual webpage I want to redirect it located here:
http://www.domain.com/2008/01/filename.html

I would like it to redirect to:
http://www.domain.com/wp/filename

Note that the second URL is at the same domain, but it does not have an extension.

From the DreamHost home directory, the full path to the domain is:
/home/domain/domain.com/etc.

I’ve tried many variations of Redirect 301 that I’ve found here and elsewhere, but none of the work.

I am not certain in which folder the .htaccess should go.

Also, there already exist .htaccess files in the folders ‘domain’ and ‘domain.com’. These already contain text, and I am trying to add the Redirect to those existing files.
Is it possible that these .htaccess files are conflicting with each other, or that the stuff that is already in there is conflicting with the Redirects that I’m trying to add?

All help appreciated.

Thank you.


#2

> http://www.domain.com/2008/01/filename.html -> http://www.domain.com/wp/filename

Static redirect in .htaccess:

redirect 301 /2008/01/filename.html http://www.domain.com/wp/filename > I am not certain in which folder the .htaccess should go.

In the same directory as the file, or a parent directory.

> Also, there already exist .htaccess files in the folders ‘domain’ and ‘domain.com’.

You might consider amalgamating them.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#3

Thanks for the reply. That’s what I’ve been doing, but it just isn’t working. I’m using the .htaccess that is in the root of the site: domain.com.

That htaccess file contains the following. Could that be a problem?

Generated by Dreamhost. DO NOT modify!!!

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www.)?domain.com($|/) [NC]
RewriteRule .(gif|jpg|jpeg|png|mp3|mpg|avi|mov)$ - [F,NC]

###############################################

Thanks again.


#4

That code just stops people hotlinking your image files and should not inhibit other directives placed below it.

It may be that directives in a parent folder are getting in your way.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#5

For some reason I’m unable to get this to work. Even when I remove the .htaccess file from the parent folder (which only had an Ignore * directive), it’s just not happening.

I’ve carefully checked that it is typed correctly, etc., but it’s just not happening.


#6

Add this line to the .htaccess file you’re editing and see if it affects anything:

RemoveHandler .php .phtml .php3 RemoveType .php .phtml .php3Result should be PHP isn’t parsed and source being returned as plain text.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#7

I just tried that. It had the effect of inhibiting WordPress from posting.


#8

The return should be something like this (plain text):

[code]<?php
/**

  • Front to the WordPress application. This file doesn’t do anything, but loads
  • wp-blog-header.php which does and tells WordPress to load the theme.
  • @package WordPress
    */

/**

  • Tells WordPress to load the WordPress theme and output it.
  • @var bool
    */
    define(‘WP_USE_THEMES’, true);

/** Loads the WordPress Environment and Template */
require(’./wp-blog-header.php’);
?>[/code]
Sounds like you’ve enabled WebDAV like in this thread.

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost


#9

I definitely don’t have WebDAV enabled.


#10

[quote]### Generated by Dreamhost. DO NOT modify!!! ###

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^https?://(www.)?domain.com($|/) [NC]
RewriteRule .(gif|jpg|jpeg|png|mp3|mpg|avi|mov)$ - [F,NC]

###############################################[/quote]
That isn’t present by default - it’s been generated via the Panel by some means.

Somewhere like [color=#00CC00]Panel > Goodies > Htaccess/WebDAV[/color]

Maximum Cash Discount on any plan with MAXCASH

How To Install PHP.INI / ionCube on DreamHost