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
-
Is it better to shorten my existing url to use only keyword after domain with a 301 redirect from existing url
I have a long existing URL that has included my key word but the url has about 5 additional words in the text ( eg url would have " /super widgets in stock at the widget store " as url text after domain. keywords is super widget The URL was at the top of search results for my keyword for many years until recently. Is it better to shorten my url text to now use only my keyword " /super-widgets " after the domain with a 301 direct from my existing url to optimize it Thanks
On-Page Optimization | | mrkingsley2 -
Help with Temporary Redirects on Pages
Hi Guys, My latest crawl shows this: "44% of site pages served 302 redirects during the last crawl" When I click this to investigate the issue I see: URL:
On-Page Optimization | | jeeyer
https://www.....
https://www.....
https://www.....
https://www.....
https://www..... And under Redirect URL:
http://www....
http://www....
http://www.... I've recently read an article from Yoast that this is a https:// to http:// redirect (ofcourse 😉 ).
but why is this an issue that needs to be solved and how do I solved it? Thanks again for your help and thoughts. Joost0 -
Does name of town in title tag help if queries don't include the town name?
Hi. Wanted to know if targeting local traffic online and the search volume of KWs in the area do not include the local names (according to KW planner) does it still help to keep the town names in the title tag? does google deliver local results based on location names in title tag if query didn't mention it?
On-Page Optimization | | Morris770 -
What is the best way to execute a geo redirect?
Based on what I've read, it seems like everyone agrees an IP-based, server side redirect is fine for SEO if you have content that is "geo" in nature. What I don't understand is how to actually do this. It seems like after a bit of research there are 3 options: You can do a 301 which it seems like most sites do, but that basically means if google crawls you in different US areas (which it may or may not) it essentially thinks you have multiple homepages. Does google only crawl from SF-based IPs? 302 passes no juice, so probably don't want to do that. Yelp does a 303 redirect, which it seems like nobody else does, but Yelp is obviously very SEO-savvy. Is this perhaps a better way that solves for the above issues? Thoughts on what is best approach here?
On-Page Optimization | | jcgoodrich0 -
Should I redirect mobile traffic to a different url? Will it hurt SEO?
I'm working on a site that has lots of great content and ranks well but essentially the money is generated by affiliate links. I don't have a mobile version of the site but the company I'm affiliated with does offer a mobile redirect to their domain. Will redirecting mobile traffic to a different url hurt my SEO? I think the user will get a better experience by landing on a mobile page but I don't know if google will see it like that. Any thoughts?
On-Page Optimization | | SamCUK0 -
301 redirect usage
I just wondering if using a lot of 301 redirects could hurt to my seo? We have site which have a lot of content with such links: title: This Is Title page url: www.site.com/This-Is-Title-page.html and we use for each page 301 redirect to remove capital letters in url: www.site.com/this-is-title-page.html Is this is good idea and not hurting to seo ? Thanks in advance
On-Page Optimization | | bele0 -
Google found bad links delete them or 301 redirect?
we went into our google account and saw about 70 bad links that they found on our site. what's the best thing to do, seo-wise: should we go into the pages that have the bad links and delete them from the html code, or re-direct them in our htaccess script?
On-Page Optimization | | DerekM880 -
301 redirects / clean urls
hello everyone, we moved our site to a new platform that has url rewrite feature. we are building out a spreadsheet of the old aspx urls and the corresponding page on the new site. my dev tells me that its not important to redirect the old page to the new "clean url" page which sounds a bit odd to me ..example below. okay. so he says its the same difference to 301 redirect this url: http://72.3.181.97/catalog/DesignerDogBeds.aspx to this urls: https://www.k9electronics.com/product.php?productid=3474 instead of this clean url: http://www.k9electronics.com/designer-dog-beds/ can anyone give me any feedback on this? thanks!
On-Page Optimization | | k9byron0