www.webdeveloper.com
Results 1 to 3 of 3

Thread: Moving DotNetNuke to WordPress, need .htaccess help

Hybrid View

  1. #1
    Join Date
    Nov 2009
    Posts
    7

    Question Moving DotNetNuke to WordPress, need .htaccess help

    I am converting a DotNetNuke/aspx site to a WordPress/php site on a different ISP.

    The domain name will be the same.

    Currently on Google there are about 5 links for .aspx pages that I'd like to redirect to their new WP home


    • any "old" URL containing "/?id=43" should go to "/page-one"
    • any "old" URL containing "/?id=21" should go to "/page-two"
    • any "old" URL containing "/?id=67" should go to "/page-three"
    • any "old" URL containing "/?id=03" should go to "/page-four"
    • any "old" URL containing "/?id=59" should go to "/page-five"
    • any other incoming but now invalid URL should just default to the home page


    Note that there are a few Google links beside the main 5 that refer to pages that have no direct new counterpart - hence the last item in the above list.

    Besides doing these 6 redirects/rewrites the .htaccess should have the usual "good practice" stuff in it, including

    • change non-www prefix to www
    • add trailing slashes where appropriate


    ...and here is the .htaccess code that was generated for the new WP site:

    Code:
    # BEGIN WordPress
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteBase /
    RewriteRule ^index\.php$ - [L]
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule . /index.php [L]
    </IfModule>
    
    # END WordPress
    MY PLEA FOR HELP

    Starting with the Wordpress-generated code, I have spent hours trying to get all these conditions to work in a single .htaccess file. I don't want to move the site yet until I get a working .htaccess file coded, so in the meantime I have been using the online tool at "htaccess.madewithlove.be" which seems very useful but I cannot find the right combo.

    Heck, at this point I'm not even sure if I should be trying Rewrites or Redirects. And should I explicitly account for WP's "index.php" in that some users might use it explicitly and others may not?

    Can anyone point to an .htaccess example that would have all four of these elements:
    1) the above-listed rewrites/redirects
    2) www prefixes forced
    3) use the above Wordpress generated code
    4) default to home page for any stray "old" incoming URLs?

  2. #2
    Join Date
    Nov 2009
    Posts
    7

    Question How to eliminate trailing query parameters from output string

    Making some progress but cannot seem to eliminate appending query parameters to the output string.

    I am using:

    Code:
    RewriteCond %{REQUEST_URI} /Default.aspx$
    RewriteCond %{QUERY_STRING} ^id=43$
    RewriteRule ^.*$ http://www.acme.com/page-one? [L,R=301]
    
    RewriteCond %{REQUEST_URI} /Default.aspx$
    RewriteCond %{QUERY_STRING} ^id=21$
    RewriteRule ^.*$ http://www.acme.com/page-two? [L,R=301]
    I am trying to accomplish these rewrites:

    http://acme.com/Default.aspx/?id=43 --> http://www.acme.com/page-one
    http://acme.com/Default.aspx/?id=21 --> http://www.acme.com/page-two

    ... but I am ending up with this:

    http://acme.com/Default.aspx/?id=43 --> http://www.acme.com/page-one?id=43
    http://acme.com/Default.aspx/?id=21 --> http://www.acme.com/page-two?id=21

    How do I eliminate the ?id=xx parameters at the end of the new URL? (I thought the trailing "?" would do it but no luck so far)

  3. #3
    Join Date
    Mar 2012
    Posts
    10
    Check out the following URL … Hopefully helpful for you …


Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles