How to 301 redirect all URLs with /? in?
-
I want to redirect all URLs that have /? in it.
Indexed in Google is a bunch of urls lik:
I want all these URLs to be redirected to my home page.
Any ideas?
-
Just looked at the code and yes it does have rel=canonical
I had no idea that this would tell google its the same as the home page
Thanks for helping, really appreciate it.
-
It looks like you might not have anything to worry about then. pick an example of that url with ?zxxxxx. look at the page source (in firefox, go to tools, web developer, then page source) look for "rel=canonical". if the url indicated there is your homepage then you have nothing to worry about. after a few crawls, Google will know that the url is the same as the home and will remove those urls from the index.
-
Hi Duke, appreciate your help.
The URLs such as mysite.com/?674764 dont have a page. When you visit the URL it just shows the home page.
Ive just looked at another Wordpress site and added this /? in the URL, again it shows the home page without redirecting the URL
See here: http://yoast.com/?
Infact you can enter anything after the /? and it will still show the home page
-
Ok. have a look at the page source and see what canonical is shows. if its pointing to the current homepage then leave it for a while. Google will catch up with and remove it from the index. if not the post a full url here so i can take a look for you.
-
No the URLs just show the home page and not a 404
There are hundreds of them, so would it not be easier to make a 301 rule in the htaccess that redirects all urls that have /? in, rather then manually redirecting each URL?
-
Are these urls currently leading to a 404 page? if they are then follow these steps
- Download the list from Google webmaster tools, use "text to columns" in excel to break the url up so you have "/?xxxx" in one column.
- Install http://wordpress.org/extend/plugins/wordpress-seo/ and go through all the right setup
- click on "edit files" submenu and add this rule Redirect 301 /?xxxx http://www.homepage.com (where /?xxx is the url you want to redirect and "hompage" is the correct url of your homepage.
Hope this helps
-
The URLs have been indexed by Google from an old site.
The new site is now a Wordpress site.
To tidy up what Google has indexed I want to redirect these /? URLs to the home page.
I have tried the "link juice keeper" plugin but that did not work.
I really need to know what code I need to put in the htaccess file to do this. i have tried a whole bunch of things but cant get it to work
-
It depends on the type of system you used to create your website. Speak to your developers and they can create a rule in your htaccess file that will redirect all urls with /?.
Before you do that you need to establish why you want to redirect them and how those urls were created in the first place. understanding how they came about might unearth a cms related issue which can be better address with canonical, webmaster tools url paremeters or other techniques of avoiding duplicate content.
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
-
A Really Specific Question about 301 Redirect Strategies
Hi there: As part of a site redesign project, we've been doing a lot of 301 redirects, as we retire old URLs or rename them. My question is: is it necessary to redirect ALL old URLS? What about URLs with no links and low authority? Are these really necessary to redirect, since they're not referenced on the web and there's obviously a global redirect happening at the level of the root domain? Just curious; I'm not sure I've ever really understood this...
Intermediate & Advanced SEO | | Daaveey0 -
(Urgent) losing traffic after 301 redirect
We face a seo problem of losing traffic after 301 redirect.We have used 301 redirect from a sub-domain url to main domain, after a few month, we discovered that the traffic in google is dropped 40% as well as yahoo dropped 50% without reason, we have updated sitemap already, but we cannot find any reason for the traffic dropped till now..The original url (more then 5000 links)https://app.example.com/ebook Redirected Urlhttps://www.example.com/ebookThank you for your help!
Intermediate & Advanced SEO | | yukung0 -
How to handle potentially thousands (50k+) of 301 redirects following a major site replacement
We are looking for the very best way of handling potentially thousands (50k+) of 301 redirects following
Intermediate & Advanced SEO | | GeezerG
a major site replacement and I mean total replacement. Things you should know
Existing domain has 17 years history with Google but rankings have suffered over the past year and yes we know why. (and the bitch is we paid a good sized SEO company for that ineffective and destructive work)
The URL structure of the new site is completely different and SEO friendly URL's rule. This means that there will be many thousands of historical URL's (mainly dynamic ones) that will attract 404 errors as they will not exist anymore. Most are product profile pages and the God Google has indexed them all. There are also many links to them out there.
The new site is fully SEO optimised and is passing all tests so far - however there is a way to go yet. So here are my thoughts on the possible ways of meeting our need,
1: Create 301 redirects for each an every page in the .htaccess file that would be one huge .htaccess file 50,000 lines plus - I am worried about effect on site speed.
2: Create 301 redirects for each and every unused folder, and wildcard the file names, this would be a single redirect for each file in each folder to a single redirect page
so the 404 issue is overcome but the user doesn't open the precise page they are after.
3: Write some code to create a hard copy 301 index.php file for each and every folder that is to be replaced.
4: Write code to create a hard copy 301 .php file for each and every page that is to be replaced.
5: We could just let the pages all die and list them with Google to advise of their death.
6: We could have the redirect managed by a database rather than .htaccess or single redirect files. Probably the most challenging thing will be to load the data in the first place, but I assume this could be done programatically - especially if the new URL can be inferred from the old. Many be I am missing another, simpler approach - please discuss0 -
301 redirecting a site that currently links to the target site
I have a personal blog that has a good amount of back links pointing at it from high quality relevant authoritative sites in my niche. I also run a company in the same niche. I link to a page on the company site from the personal blog article that has bunch of relevant links pointing at it (as it's highly relevant to the content on the personal blog). Overview: Relevant personal blog post has a bunch of relevant external links pointing at it (completely organic). Relevant personal blog post then links (externally) to relevant company site page and is helping that page rank. Question: If I do the work to 301 the personal blog to the company site, and then link internally from the blog page to the other relevant company page, will this kill that back link or will the internal link help as much as the current external link does currently? **For clarity: ** External sites => External blog => External link to company page VS External sites => External blog 301 => Blog page (now on company blog) => Internal link to target page I would love to hear from anyone that has performed this in the past 🙂
Intermediate & Advanced SEO | | Keyword_NotProvided0 -
Redirect 301 still works?
Hi, yesterday a friend said that 301 redirects does not transfer your page rank or domain autorithy anymore. I could'nt find anything in internet saying it, but I decided to ask you guys, since I think you are very reliable. so, 301 redirects wroks for transfer page rank, and i can create better domains and transfer everything, or this strategy is gone forever now?
Intermediate & Advanced SEO | | chablau0 -
What happens to 301 redirect if the site taken down?
I understand 301 redirect carries over the page value to the page its being redirected to. However what happens if for example, I do a 301 redirect from example.com to example.co.uk, 2 months later I take down hosting and cancel domain for example.com, would I lose the page value that was being carried over to example.co.uk? Do I need to keep both domains active?
Intermediate & Advanced SEO | | Marvellous0 -
CMS Pages - Multiple URLS (/)
Hi guys, this type of question has been asked a few times before but I couldn't find something that told me what i need so apologies if its a tad repetitive. I use Magento, and have several pages using its CMS. However, it produces 2 URLS for each page with a simple /. For example, website.com/hire
Intermediate & Advanced SEO | | ATP
website.com/hire/ I know google treats this as 2 separate pages, which would be the better solution. 1. Write a URL re-write for every CMS page
RewriteRule ^hire$ http://www.website.com/hire/ [R=301,L] (Is this right?) 2. Write a general rewrite rule to always add the /
No idea where to begin with this 3. Add a Canonical tag to the page which i think is possible in magento by adding this to the Custom Design Layout XML option in the page CMS. <action method="addLinkRel"></action> <rel>canonical</rel> <href>http://www.website.com/hire/</href> This would make the /hire/ page self-reference and the /hire page reference the /hire/ page I think. Which one of these solutions is the best and any pointers with the coding would be grand.0 -
301 v/s 302 Redirection on Homepage (Multilingual)
Hello, Our website: http://www.luxresorts.com currently has a default 302 redirection to http://www.luxresorts.com/en. We would like to do a 301 redirection instead of a 302 to http://www.luxresorts.com. Our concern is that the site is multilingual and we wonder what effect would the 301 redirection have on search engine crawlers and how would this appear on SERP. When a search is done on Google.com, the English version of our website appears and when on Google.FR, the French version appears. Would the 301 redirection change the way our website appear on Google? Grateful if you could help us out in understanding the pros and cons/best practices for our concern. Thanks in advance. Tej Luchmun.
Intermediate & Advanced SEO | | luxresorts0