We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 41720
    • 2 Posts
    haydyn_phillips Reply #1, 14 years ago
    Hi All,

    I know there has been many discussions on 301's etc, but we are at a loss with a solution for an issue we have.

    We moved an old site hosted on windows (.aspx) to a new PHP server.

    In a nutshell we want to redirect the old .aspx urls to the new ones.

    There are 2 things we need to do:

    1. Redirect old .aspx urls to folders (e.g) http://www.mysite/flowers/roses/

    2. Redirect old .aspx urls to new .html urls (e.g) http://www.mysite/flowers.html

    Our developers have tried pretty much everything under the sun to get this working, they know about the various issues with a conflict between mod_rewrite and mod_alias but they cannot get anything to work.

    They are also aware it could be an issue with friendly url's.

    A typical redirect is:

    #Redirect 301 http://mysite.co.uk/folder/my-url.aspx http://www.mysite.co.uk/folder/

    or

    #RewriteCond %{HTTP_HOST} !^www\.mysite.co.uk/folder/my-url\.aspx
    #RewriteRule (.*) www.mysite/folder/$1 [R=301,L]


    If anyone has any ideas or suggestions or needs any other config files from us so we can gain our sanity back it would be much appreciated smiley

    Thanks
    H


      • 28042 ☆ A M B ☆
      • 24,524 Posts
      You could just change the default suffixes to .aspx - MODx really doesn't care what they are.
        Studying MODX in the desert - http://sottwell.com
        Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
        Join the Slack Community - http://modx.org
        • 41720
        • 2 Posts
        haydyn_phillips Reply #3, 14 years ago
        Hi thanks for replying, we tried changing the suffixes in the database but still no joy :-(
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          You need to change them in System -> Content Types for regular HTML documents, and System Settings, the setting for container_suffix. For this to work, you'll also need to turn off use_alias_path in System Settings. [ed. note: sottwell last edited this post 14 years ago.]
            Studying MODX in the desert - http://sottwell.com
            Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
            Join the Slack Community - http://modx.org
            • 28042 ☆ A M B ☆
            • 24,524 Posts
            You could also create a plugin to perform custom page-not-found processing, using the OnPageNotFound event.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org