homepage Welcome to WebmasterWorld Guest from
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
Become a Pro Member
Home / Forums Index / Code, Content, and Presentation / Apache Web Server
Forum Library, Charter, Moderators: Ocean10000 & incrediBILL & phranque

Apache Web Server Forum

htaccess question - redirecting *most* of a site
need to preserve access to a script in a local subdirectory

5+ Year Member

Msg#: 4022415 posted 3:25 pm on Nov 10, 2009 (gmt 0)

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?/




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

Msg#: 4022415 posted 3:57 pm on Nov 10, 2009 (gmt 0)

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.


Global Options:
 top home search open messages active posts  

Home / Forums Index / Code, Content, and Presentation / Apache Web Server
rss feed

All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
Home ¦ Free Tools ¦ Terms of Service ¦ Privacy Policy ¦ Report Problem ¦ About ¦ Library ¦ Newsletter
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved