Forum Moderators: phranque

Message Too Old, No Replies

permanent redirect not working correctly

         

koala_kid

12:20 am on Apr 2, 2009 (gmt 0)

10+ Year Member



Hi, I've recently moved domains and so have set up a .htaccess file to redirect old pages to new. The redirect is working but its passing through the old url path to (the site is built in cakePHP which explains the action in the url):

eg:

Redirect permanent /page/139 http://www.example.com/my-action/promotions-main

resolves to
http://www.example.com/page/promotions-main

I'm fairly new to .htaccess and have no idea what is causing this. Does anyone have a suggestion?

Thanks in advance.

[edited by: jdMorgan at 6:05 am (utc) on April 2, 2009]
[edit reason] example.com [/edit]

jdMorgan

6:05 am on Apr 2, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It is likely that either you have other code in this .htaccess file or in another .htaccess file in the path to the new or the old URL-path that is interacting with your Redirect directive.

If you have any mod_rewrite directives as well as this mod_alias directive, then it is possible that the execution order is incorrect: Be aware that "code" in .htaccess is not executed in the order that it is written. Rather, each Apache modules parses the .htaccess file, and executes the directives that it recognizes. The module execution order is determined by the server configuration.

When posting 'trouble reports' here, please provide the following basic info needed for describing and troubleshooting the problem:

How did you test? (e.g. What URL did you type?)
What were the results? ("It doesn't work" is not a useful answer)
What were the results that you expected?
How did the actual results differ from your expectations?

If there are other directives which perform either external redirects or internal rewrites, and which may be interfering with your new directive, please post them (unless they are copyrighted).

Thanks,
Jim