Skip to content
General Revolution Evolution Add-ons International
Login | Register | MODX.com
MODX Open Source Content Management System, Framework, Platform and More.
Find a Partner | Hosts + SaaS | Jobs | Donate
  • RegisterSign Up with the MODX Community
  • LoginUse Your MODX.com Account
  • MODX Community Forums
  • General
  • General Support
  • E-Commerce, E-Marketing, Analytics & SEO
  •  
  • .htaccess, 301 redirects with questions marks and special characters#

  • 11858
    130

    Hat-rack Reply #1, 1 year, 2 months ago

    Reply
    • Link to this post#1
    I'm trying to redirect a URL:

    www.example.com/content.aspx?ID=2&ParentID=60&MicrositeID=0&Page=1


    to

    www.example.com/products


    My rewriteCond looks like this (I'm using MODx as a CMS)

    # For Friendly URLs
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
    
    Redirect 301 /content.aspx?ID=60&ParentID=0&MicrositeID=0&Page=1 http://www.example.co.uk/products
    
    
    


    Does anyone have any idea how specify a rewrite rule for a url with so many question marks, ampersands and parameters in it? I probably need to do rewrite rules for everything, not just simple redirects?


  • 17553
    1
    Computer Science Graduate and Facebook Application Developer

    Loxzibit Reply #2, 11 months, 2 weeks ago

    Reply
    • Link to this post#2
    You can try the following:
    RewriteRule ^content.aspx?ID=2&ParentID=60&MicrositeID=0&Page=1 /products [R=301,L]

    Friendly URLs part
    # The Friendly URLs part
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]



  • 36575
    55

    rachelmarama1 Reply #3, 11 months, 2 weeks ago

    Reply
    • Link to this post#3
    I used the spreadsheet here: http://www.mbstrategic.com/02/301-redirects-for-dynamic-urls-to-static-pages-with-htaccess/

    Your code would be:
    RewriteCond %{QUERY_STRING} ^ID=2&ParentID=60&MicrositeID=0&Page=1$
    RewriteRule ^content.aspx$ www.example.com/products? [R=301,L]






Actions

Login to Post

Other Support Options

To file a bug or make a feature request visit our issue tracker, or you can also purchase commercial support.

Love MODX?

If you build sites for a living with MODX or just love using it, why not give back?

Information

Posted in this thread:
Hat-rack, Loxzibit, rachelmarama1

 
Back to Top

MODX Global HQ

1333 N Stemmons Fwy, Ste 110
Dallas, TX 75207
United States

+1 (469) 777-MODX (6639)

The MODX Company

  • Contact
  • Media Center
  • Careers at MODX
  • Wall of Fame
  • The MODX Blog

Sponsors

SoftLayer Firehost: Secure Cloud Hosting

Stay Connected

Read our previous email newsletters.

Twitter Facebook Google+ LinkedIn github Feeds

Privacy Policy | Terms of Service | Pixels by AKTA Web Studio© 2005-2012 MODX. All rights reserved. Trademark Policy