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
-
Should I redirect a popular but irrelevant blog post to the home page?
Hi. I'm trying to get my website; www.ciphr.com , to rank for keywords relevant to "HR Software" in the UK. It's a highly competitive industry and we rank ~mid to low on page one for some of our ideal keywords that are highly relevant and high volume. Years ago we took the decision to blog about topics more loosely related to the world of work. One of our blog posts, about plants in the office https://www.ciphr.com/advice/plants-in-the-office/ is popular. It gets decent traffic and consistently builds backlinks to the post without any further effort on our part. The specific page has a PA of 46 and DA of 55 with >500 domains linking to it. This compares to our home page with a PA of 47 and 700 linking domains. It is typically the home page that ranks for our money keywords "HR Software" "HR Systems" in the UK. Because this blog post is so loosely related to our actual business, the traffic it generates is highly unlikely to turn into a customer of ours. I am considering redirecting the blog post to the home page to pass link juice to the home page. The concern I have is that, based on the anchor text and contextual signals from linking pages, Google might then infer that our home page is less relevant for our money keywords and more relevant for "plants". Are my concerns unfounded? What are your thoughts? Should I redirect the blog post to the home page? Another internal page? Keep the blog post live? Thanks
On-Page Optimization | | crichardson19922 -
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 -
301 Redirect to external site
Hi guys, We have a client who is getting their website redesigned through us. They are discontinuing couple of their services which will not get featured in the new site. They are fairly well ranked for these services and my client wishes to 301 redirect these pages to an external site owned by his friend so that they benefit out of the ranking. The question is: Will my client's website's general ranking get affected due to 301 redirecting to an external site? The external site is not spammy or red-flagged by Google (at the moment, at least). Thanks in advance!
On-Page Optimization | | RameshNair
Ramesh Nair0 -
Redirecting https pages
If I add 301 redirects from the https versions of the root domain to the http:www.website.com (canonical version), will this prevent users from being able to access the https version? I believe the https version is only accessed once users log into the site. Thank you!
On-Page Optimization | | HiddenPeak0 -
How to do this 301 redirection
Hi there! I have two domains with the same content. Some guys in this forum posted that It would be convinient to do a 301 redirect from one ".com" domain to ".es" domain (my potential market). I just tried to set it up in the htaccess file but it dind't worked at all. Something like: redirect 301 http://wwww.domain.com http://www.domain.es I just configure in the webmaster tools the domain www.domain.com as preferred domain insted of http://domain.comThe same with the other domain. Any help? many thanks
On-Page Optimization | | juanmiguelcr0 -
How do I do a 301 Redirect in Wordpress
I have several pages that are showing up as "duplicate" on my Wordpress based site based upon the structure of site. I was wondering how to do a 301 redirect for these pages
On-Page Optimization | | SteveSweat0 -
The best way to redirect to www
What is the best way to redirect non www to www. I saw a lot of the solution. is this one ok? RewriteCond %{HTTP_HOST} !^www.seomoz.org [NC] RewriteRule (.*) http://www.seomoz.org/$1 [L,R=301]
On-Page Optimization | | bruki0 -
What does this mean on first step up setting up a campaign? "Having two "twin" domains that both resolve forces them to battle for SERP positions, making your SEO efforts less effective. We suggest redirecting one, then entering the other here."
I am BRAND new to this, and setting up my first campaign. I choose subdomain, and entered www.pdsaz.com. This is the message I receive: We have detected that the domain www.pdsaz.com and the domain pdsaz.com both respond to web requests and do not redirect. Having two "twin" domains that both resolve forces them to battle for SERP positions, making your SEO efforts less effective. We suggest redirecting one, then entering the other here.
On-Page Optimization | | cschwartzel0