Welcome to WebmasterWorld Guest from 107.22.87.205

Forum Moderators: Ocean10000 & incrediBILL & phranque

Message Too Old, No Replies

htaccess question - redirecting *most* of a site

need to preserve access to a script in a local subdirectory

     
3:25 pm on Nov 10, 2009 (gmt 0)

5+ Year Member



I'm using htaccess to redirect pages from an old site to a new site in the following fashion:

redirect 301 /states/ http://www.example.com/states/

I'm redirecting the home page of site #1 to an interior page in site #2:

redirect 301 / http://www.example.com/somepage/

There's no extension on the home page URL on either site because both use URL rewriting.

What I'm trying to do is preserve access to a script that lives in the /actions/ subdirectory of the old site - call it "/actions/somescript.php". For some reason I can't use 301 redirects on that directory (e.g. "redirect 301 /actions/ http://www.example.com/actions/"), even though redirects work fine for the "phantom" directories (like /states/) that are created through the URL rewriting.

Any suggestions?/

Thanks.

3:57 pm on Nov 10, 2009 (gmt 0)

WebmasterWorld Senior Member jdmorgan is a WebmasterWorld Top Contributor of All Time 10+ Year Member



1) Use mod_rewrite instead of mod_alias, and use a RewriteCond to exclude URL-paths that you don't want redirected.

2) Check to see if MultiViews are enabled. If you don't use them, then disable them (See core "Options" directive.)

3) Check for a ScriptAlias directive in the server config files which refers to the script; This may preempt your Redirect for the script.

Jim

 

Featured Threads

Hot Threads This Week

Hot Threads This Month