Apache .htaccess query string redirects
-
With regular redirect(s) the following URLs did not work, any ideas for the .htaccess code to make this work?
http://www.domain.com/?view=featured redirect to http://www.domain.com/
http://www.domain.com/contact-us.html?view=message&layout=message&pf=1&redirect_on_success= to http://www.domain.com/contact-us.html
and
http://www.domain.com/login.html?return=aW5kZXgucGhwP29wdGlvbj1jb21fcGhvY2Fkb3dubG9hZCZ2aWV3PWNhdGVnb3J5JmlkPTEyOmNvbWJpbmUtZXZhbHVhdGlvbiZJdGVtaWQ9NzM4 to http://www.domain.com/login.htm
Thanks guys!
-
Hi Dan,
Thanks for this! I had initially asked and then without getting an answer had to go dig around and figure this out myself. At the end of the day I made it happen!
Thanks for looking through this again. Ill mark it as answered!
-
Hi Vadim
Did you have any luck with this? I found a few resources that might help (I don't have intimate experience with writing special .htaccess redirects):
-
Hi Vadim,
I am not providing you exact 301 redirect code for above URL but I have found a detailed article posted on this post that might be helpful for you but not very sure.
http://www.goinflow.com/setting-up-301-redirects-for-dynamic-urls/
Hope this helps.
Thanks
Got a burning SEO question?
Subscribe to Moz Pro to gain full access to Q&A, answer questions, and ask your own.
Browse Questions
Explore more categories
-
Moz Tools
Chat with the community about the Moz tools.
-
SEO Tactics
Discuss the SEO process with fellow marketers
-
Community
Discuss industry events, jobs, and news!
-
Digital Marketing
Chat about tactics outside of SEO
-
Research & Trends
Dive into research and trends in the search industry.
-
Support
Connect on product support and feature requests.
Related Questions
-
How do I redirect SEO from pages on old website to new website with new domain name?
How do I redirect SEO from pages on old website to new website with new domain name? My website in squarespace has good rankings and we have rebranded to a new name and enw domain name, how do I move across the rankings fomr the old site in squarespace to my new site thats in wordpress please?
On-Page Optimization | | Carrotpower0 -
How To Avoid Redirect Chains When Switching From http to https
I have been working on on-page SEO which has involved switching from http to https, and renaming URLs. I am running in to issues with redirect chains. Here is a scenario: Old URL: http://bwisecontractors.ca/products/decks-and-deck-covers/ New URL: https://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ Since I already created the redirect addressing the redirecting from http to https for the root domain: (http://bwisecontractors.ca to https://bwisecontractors.ca), should the redirect for the above be http://bwisecontractors.ca/products/decks-and-deck-covers/ to https://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ , or should it be http://bwisecontractors.ca/products/decks-and-deck-covers/ to http://bwisecontractors.ca/renos-additions/sunrooms-patio-covers/ (and the root domain redirect will take care of going from http to https)
On-Page Optimization | | BWiseContractors0 -
Redirects for new site new urls?
If redoing a site and updating some of the url's for SEO should you do permanent redirects for the old sites url's ? Using WordPress. I saw that the Yoast Pro plugin allows you to do this inside WordPress , is this the best way? Suggestions.? I know there are old articles written out on the web pointing back to the what will be soon old url's so just wondering what's the best way to go about this. Thanks Scott
On-Page Optimization | | scott3150 -
Should old pages that have being 301 redirected but have no/mimimal traffic be deleted?
In other words, I have pages from years ago that are redirected but how can I tell if traffic still flows through them? And if there is no or minimal traffic should the 301 be deleted? Linck
On-Page Optimization | | LinckB0 -
Redirecting deleted posts 301 vs 302
There is a category on WP where job ads are posted. when a post got deleted I would like to pass 404 error page and redirect all those deleted posts to specific category. I found WP plugin Auto Redirect 404 in 301 for Trashed Posts which does redirect deleted post to specific URL. But posts which are in the trash (not permanently deleted) will get 302 redirects. Those deleted permanently will get 301 redirects. Should I try editing this plugin or find another why? Maybe there is similar way with Redirection plugin?
On-Page Optimization | | OVJ0 -
How Much Does a Missing www. 301 redirect hurt a business?
We're preparing a report for a potential client, and are trying to figure out a way to estimate rankings gains. One of the major issues is a lack of a 301 redirect for non-www. domains to www. domains. We checked and there's no canonicalization, so it's a clear issue. According to Google, the non-www. links from 8 different domains. The www. version of the website has links from 248 different domains. Nearly all anchor text is branded, as they've never had any SEO work done before. Does anyone have a suggestion for approximating benefits of setting up their .htaccess file correctly? Would the benefits even be that great? We're of course advising additional things, but we just want to be more certain about this step's SEO-boost.
On-Page Optimization | | FlynnZaiger0 -
Removed listings: 404, internal links or redirect?
For a classifieds web site with medium/high turnover for the various listings: How would you deal with pages of removed listings? a) would you be "honest" and return a 404 since the listing is not available anymore? b) would you maintain historical data about deleted listings so that you can try and 301 redirect to a relevant search results page? c) would you keep the page alive (maybe add a noindex meta tag?) and show links to multiple relevant search results pages in an effort to strengthen internal linking?
On-Page Optimization | | seo-cat0 -
Use 301 redirects when deleting old products?
I'm removing old products (wines) from my site, and I've been using 301 redirects for each product page back to the winery page. My question is, am I using best practice? I want people who search for these now nonexistent products to go to the winery page where they will see what is now available. But does google approve? I've also tried leaving the product's page intact but saying that it is no longer available and putting a link in the text that points to the winery page. Which is better, in the eyes of the god google? Thanks!
On-Page Optimization | | JeanYates0