Moz Q&A is closed.
After more than 13 years, and tens of thousands of questions, Moz Q&A closed on 12th December 2024. Whilst we’re not completely removing the content - many posts will still be possible to view - we have locked both new posts and new replies. More details here.
301 Redirect non existant pages
- 
					
					
					
					
 Hi I have 100's of URL's appearing in Search Console for example: ?p=1_1 These go to on to 5_200 etc.. I have tried to do htaccess and the mod rewrite is on as I can redirect directories to the root i.e RewriteRule ^web_example(.*)$ /$1 [R=301,N,L] However I have tried all kinds of variations to redirect ?p= and either it doesn't work at all or it crashes the website. Can anyone point me in the right direction to fix this. 
- 
					
					
					
					
 RewriteCond %{QUERY_STRING} ^p=([0-9_])$ 
 RewriteRule ^(.)$ /p/%1? [R=301,L]the above works on our test area but not on clients so it hosting issue 
- 
					
					
					
					
 Thanks Chris Seems there is an issue with the web host. 
- 
					
					
					
					
 Hi James, Assuming you want to keep the existing setup but set up friendlier URLs (example, redirect ?p=1_14 to /p/1_14), you could do something like this: RewriteCond %{REQUEST_URI} ^p=([^&]+) [NC,OR] 
 RewriteCond %{REQUEST_URI} &p=([^&]+) [NC]
 RewriteRule .* /p/%1? [R=301,L,NE]Then you'd want something to handle those new URL requests with something like this: RewriteRule "^p/(.*)$" "/index.php?p=$1" [L,NE] Hope this helps! 
- 
					
					
					
					
 It's from an old website so the pages no longer exist. I will have a look at the link you sent over thank you. 
- 
					
					
					
					
 Hi, Something is generating those links, and that is what I would want to fix. It sounds like a module or add-on is incorrectly coded, or installed improperly. As p=1_1 is usually a form of pagination and / or sort order. You could of course easily fix it by putting a canonical tag on the root page to itself or work out a mod rewrite rule, but that isn't actually fixing the problem. As soon as you add another category you may have to revisit the fix again. Here is an example of using mod re-write on Stack Overflow: http://stackoverflow.com/questions/14666140/htaccess-rewriting-php-pagination I hope that helps, Don 
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 ToolsChat with the community about the Moz tools. 
- 
		
		SEO TacticsDiscuss the SEO process with fellow marketers 
- 
		
		CommunityDiscuss industry events, jobs, and news! 
- 
		
		Digital MarketingChat about tactics outside of SEO 
- 
		
		Research & TrendsDive into research and trends in the search industry. 
- 
		
		SupportConnect on product support and feature requests. 
Related Questions
- 
		
		
		
		
		
		How effective are 301 redirects in passing page rank?
 I have a blog which is ranking well for certain terms, and would like to repurpose it to better explain these terms it is ranking for, including updating the url to the new term the blog will be about. The plan being to 301 redirect the old url to new. In the past, I've done this with other pages, and have actually lost much of the rankings that I had earned on the original URL. What is your take on this? Maybe repurpose blog, but maintain original URL just to be on the safe side? Thanks Technical SEO | | CitimarineMoz0
- 
		
		
		
		
		
		Solved Should I consolidate my "www" and "non-www" pages?
 My page rank for www and non-www is the same. In one keyword instance, my www version performs SO much better. Wanting to consolidate to one or the other. My question is as to whether all these issues would ultimately resolve to my chosen consolidated domain (i.e. www or non-www) regardless of which one I choose. OR, would it be smart to choose the one where I am already ranking high for this significant keyword phrase? Thank you in advance for your help. Technical SEO | | meditationbunny0
- 
		
		
		
		
		
		What is the difference between 301 redirects and backlinks?
 i have seen some 301 redirects on my site billsonline, can anyone please explain the difference between backlinks and 301 redirects, i have read some articles where the writer was stating that 301 are not good for website. Technical SEO | | aliho0
- 
		
		
		
		
		
		Proper 301 redirect code for http to https
 I see lots of suggestions on the web for forwarding http to https. I've got several existing sites that want to take advantage of the SSL boost for SEO (however slight) and I don't want to lose SEO placements in the process. I can force all pages to be viewed through the SSL - that's no problem. But for SEO reasons, do I need to do a 301 redirect line of code for every page in the site to the new "https" version? Or is there a way to catch all with one line of code that Google, etc. will recognize & honor? Technical SEO | | wcksmith10
- 
		
		
		
		
		
		301 redirect adding trailing slash to url
 I am looking into a .htacess file for a site I look after and have noticed that the urls are all 301 redirecting from a none slash directory to a trailing slashed directory/folders. e.g. www.domain.com/folder gets 301 redirected to www.domain.com/folder/ Will this do much harm and reduce the effect on the page and any links pointing to the site be lessened? Secondly I am not sure what part of my htaccess is causing the redirect. RewriteCond %{HTTP_HOST} !^www.domain.co.uk [NC] RewriteCond %{HTTP_HOST} !^$ Technical SEO | | TimHolmes
 RewriteRule ^(.*) http://www.domain.co.uk/$1 [L,R,NE] RewriteCond %{THE_REQUEST} ^./index.php
 RewriteRule ^(.)index.php$ /$1 [R=301,L] or could a wordpress ifmodule be causing the problem? Any info would be apreciated.0
- 
		
		
		
		
		
		How to create a delayed 301 redirect that still passes juice?
 My company is merging one of our sites into another site. At first I was just going to create a 301 redirect from domainA.com to domainB.com but we decided that would be too confusing for customers expecting to see domainA.com so we want to create a page that says something like "We've moved. please visit domainB.com or be redirected after 10 seconds". My question is, how do I create a redirect that has a delay and will this still pass the same amount of juice that a regular 301 redirect would? I've heard that meta refreshes are considered spammy by Google. Technical SEO | | bewoldt0
- 
		
		
		
		
		
		Redirect non-www if using canonical url?
 I have setup my website to use canonical urls on each page to point to the page i wish Google to refer to. At the moment, my non-www domain name is not redirected to www domain. Is this required if i have setup the canonical urls? This is the tag i have on my index.php page rel="canonical" href="http://www.mydomain.com.au" /> If i browse to http://mydomain.com.au should the link juice pass to http://www.armourbackups.com.au? Will this solve duplicate content problems? Thanks Technical SEO | | blakadz0
- 
		
		
		
		
		
		How many jumps between 301 redirects is acceptable?
 For example, I have a page A that should be redirected to page D, but instead A redirects to B, B redirects to C and C redirects to D. It's something I came across and wondering if its worth the dev time to change it. Thanks! Technical SEO | | pbrothers240
 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				