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 a good practice to reduce number of redirections (301) after a period of time?
Is it good to use disavow tool and get rid of old URLs i.e. links for pages and posts which we have deleted from our website and added 301 on them?
On-Page Optimization | | Ravi_Rana0 -
My site auto redirects http to https. This is causing redirect chains. What can I do?
I noticed that Moz flags a lot of redirect chain issues on my site. I realized that this is mostly because the site automatically redirects http to https, and when I create a new URL (when a URL changes, for example) it is automatically flagged as a chain. Example: http://www.example-link Auto directs to: https://www.example-link Which is then redirected to: https://www.example-link-changed (when the address actually changes) I don't seem to have any control over changing where the initial http redirect goes. Any advice on fixing this problem?
On-Page Optimization | | baystatemarketing0 -
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 -
Proper Use and Interpretation of new Query/Page report
When I'm in WMT/Search Console - I start a process of looking at all of the data initially unfiltered Then I select a query. Let's say its a top query for starters and I filter my results by that top query (exactly) With the filter on, I flip over to Pages and I get about a dozen results. When I look at this list, I get the normal variety of output: impressions, clicks, CTR, avg. position One thing that seems a bit odd to me is that most of the average positions for each of the URLs displayed is about the same. Say they range from 1.0 to 1.3. Does this mean that Google is displaying the dozen or so URLs to different people and generally in the 1st or 2nd position. Does this mean that my dozen or so pages are all competing with each other for the same query? On one hand, if all of my dozen pages displayed most of the time in the SERP all at the same time, I would see this as a good thing in that I would be 'owning' the SERP for my particular query. On the other hand, I'm concerned that the keyword I'm trying to optimize a particular page for is being partially distributed to less optimized pages. The main target page is shown the most (good) and it has about a 15x better CTR (also good). But all together, the other 11 pages are taking in around 40% of impressions and get a far lower CTR (bad). Am I interpreting this data correctly? Is WMT showing me what pages a particular query sends traffic to? Is there any way to extract the keywords that a particular page receives? When I reset my query and then start by selecting a specific page (exact match) and then select queries - is this showing my the search queries that drove traffic to that page? Is there a 'best practices' process to try to target a keyword to a specific page so that it gets more than the 60% of impressions I'm seeing now? Obviously I don't want to do a canonical because each keyword goes to many different pages and each page receives a different mix of keywords. I would think there would be a different technique when your page has an average position off of page 1.
On-Page Optimization | | ExploreConsulting0 -
Redirecting to homepage ok?
I deleted a bunch of category pages (renamed mostly actually and thought they'd be auto redirected like my blog posts are but they weren't) so I used a plugin that reroutes any 404 page to the homepage. Is that the best thing to do in this situation? Google Webmasters says there are about 84 404-errors and this should get rid of those right? Is there anything SEO BAD about doing it this way?
On-Page Optimization | | dealblogger0 -
I noticed that my company owns a few exact match domains that are relevant to our business. Is it worth doing anything other than just redirecting them to our homepage?
It turns out we own a few exact match domains that are relevant to our business. Is it worth doing anything other than just redirecting? (We have owned these sites for a long time, over 15 years.) The keywords are moderate to low in traffic and moderate to high in competitiveness. (Right now they 301 to our main site.) I know exact match is not as valuable as it used to be and that there are mixed opinions about microsites...
On-Page Optimization | | Linda-Vassily0 -
Can you 301 redirect to a page that has other pages 301 to it?
Two years ago updated url page to include better keywords and used a 301 redirect from the old page to the new. so www.example.com/keyword-1st-generation.html now points to ... www.example.com/keyword-2nd-generation.html That moved the pages up in ranking, but now have better kw for the url, so is it okay to redirect the /keyword-2nd-geration-html to www.example.com/keyword-3rd-generation.html And what is a good length of time before removing the 1st-generation url? It's been 3 years and there is no chance of using it again. Plus, no sign of it in analytics.
On-Page Optimization | | AllIsWell0 -
Temp redirects of homepage URLs
Working on a site for a client and the CMS provider has all variants of their domain (.co.uk & .com and / and http:// etc) temp redirecting to the /default.aspx homepage. I know in theory that this means no Google Juice is being passed to the final location page, does this mean that all backlinks that point to their domain are not actually passing Juice onto the homepage? Thanks
On-Page Optimization | | Switch_Digital0