ederrafo Posted May 9, 2014 Share Posted May 9, 2014 Hi a question. aspx if the url has parameters? not work. I have this in my .htaccess file: Redirect 301 /ViewCatalogUI.aspx http://midomain.com/products Redirect 301 /ViewCatalogUI.aspx?.language=1&.product=1 http://midomain.com/products/product-1 Redirect 301 /ViewCatalogUI.aspx?.language=1&.product=2 http://midomain.com/products/product-2 thanks for your help Quote Link to comment https://forums.phpfreaks.com/topic/288376-301-redirect-from-aspx-to-php-via-htaccess/ Share on other sites More sharing options...
requinix Posted May 9, 2014 Share Posted May 9, 2014 Don't hijack threads. Redirect doesn't work with query strings. You do, in fact, need mod_rewrite (unless you want to do it in ViewCatalogUI.aspx). RewriteCond %{QUERY_STRING} ^$ RewriteRule /ViewCatalogUI.aspx http://www.example.com/products [L,R=301] RewriteCond %{QUERY_STRING} (^|&)\.product=(\d+)(&|$) RewriteRule /ViewCatalogUI.aspx http://www.example.com/products/product-%2 [L,R=301] Quote Link to comment https://forums.phpfreaks.com/topic/288376-301-redirect-from-aspx-to-php-via-htaccess/#findComment-1478908 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.