Welcome Guest, Not a member yet? Register   Sign In
htaccess 301 redirect help please
#6

[eluser]Daniel Moore[/eluser]
I have been rather busy lately, and just haven't had the opportunity to keep up with the forums here. Got the message, though. Good idea to contact me like that when you need help.

For starters, let me recommend you make sure that your "mod_alias" module is installed/enabled in apache. The redirect command is not a part of mod_rewrite, and you have it under that section as follows:
Code:
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    
    # 301 Redirects (old site pages redirected to new ones)
    redirect 301 "/LakesideExperience/Directions.aspx" http://lakesideohio.com/directions

If should be as follows:
Code:
<IfModule mod_alias.c>
   redirect 301 "/LakesideExperience/Directions.aspx" http://lakesideohio.com/directions
</IfModule>
<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /

...continue the rest of your .htaccess here...

You may want to verify that you have mod_alias enabled. To do so, set up an .htaccess as follows:

Code:
<IfModule !mod_alias.c>
   ASDF! THROW500ERROR!
</IfModule>

If you get a 500 Internal Server Error with that, then you do not have access to mod_alias, and therefore cannot redirect in that manner.

Now, about this line of code:
Code:
redirect 301 "/LakesideExperience/Directions.aspx" http://lakesideohio.com/directions

That code is correct, assuming the old address is at http://lakesideohio.com/LikesideExperien...tions.aspx. Your most likely problem is not having mod_alias enabled.

If mod_alias is enabled and you are still having that problem, then it is possible that the AllowOverride does not include the "FileInfo" for override.

If you are unable to enable mod_alias or do the override, then you can still use the mod_rewrite module and do a rewrite instead of a redirect. It will do the same thing if you specify a 301 redirect using the appropriate flag [R]. It can be done as follows:

Code:
RewriteRule ^/somepath(.*) /otherpath$1 [R=301]

OR for an absolute redirect:

Code:
RewriteRule ^/somepath /otherpath [R=301]

Hope this helps. Let me know if it doesn't. I've subscribed to this thread, so a reply will now alert me by email.


Messages In This Thread
htaccess 301 redirect help please - by El Forum - 06-11-2009, 09:02 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 07:37 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 07:41 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 07:46 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 07:56 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 09:09 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 09:12 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 09:15 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 09:43 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 09:55 AM
htaccess 301 redirect help please - by El Forum - 06-12-2009, 10:33 AM
htaccess 301 redirect help please - by El Forum - 06-29-2009, 01:27 PM
htaccess 301 redirect help please - by El Forum - 06-29-2009, 01:42 PM
htaccess 301 redirect help please - by El Forum - 06-29-2009, 01:47 PM
htaccess 301 redirect help please - by El Forum - 06-29-2009, 04:04 PM
htaccess 301 redirect help please - by El Forum - 05-03-2012, 06:10 AM



Theme © iAndrew 2016 - Forum software by © MyBB