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.
Htaccess - Redirecting TAG or Category pages
- 
					
					
					
					
 Hello Fellow Moz's, We have an issue redirecting some /TAG and /Category pages to inner pages. As an example we use: RedirectMatch 301 /category/Sample-Category(.*) https://OurDomain.com.au/New-Page//$1 That works well. The issue is we have other categories and tags that are named similar to /Sample-Category As an example, if we try to redirect /Sample-Category-1 to /New-Page-1 - it will not work, and redirects to /New-Page I assume this is because /Sample-Category is already being redirected, so anything after /Sample-Category like -1 or -2 or -3 etc, will not be recognized. Anyone know of a workaround? 
- 
					
					
					
					
 The regex in your RedirectMatch doesn't say what you think it says, Jes  This part (note the bolded part of the expression (.*)  /category/Sample-Category**(.*)** doesn't actually say "match the URL that is specifically** /category/Sample-Category"** That**.*** is a wildcard thatmeans "and any other additional characters that might occur here" So what it's saying is "match the URL /category/Sample-Category _**as well as **_any URLs that have any additional characters after the letter "y" in category. Which is what is catching your -1 variation of the URL (or the -size-30 in your second example). In addition, that wildcard has been set as a variable (the fact it's in brackets), which you are then attempting to insert into the end of the new URL (with the $1), which I don't think is your intent. Instead, try: RedirectMatch 301 /category/Sample-Category https://OurDomain.com.au/New-Page/ you should get the redirect you're looking for, and not have it interfere with the other ones you wish to write. Let me know if that solves the issue? Or if I've misunderstood why you were trying to include the wildcard variable? Paul P.S. You'll need to be very specific whether the origin or target URLs use trailing slashes - I just replicated the examples you provided. 
- 
					
					
					
					
 It's not as easy as that unfortunately. I will reiterate.....If we redirect..... RedirectMatch 301 /category/Blue-Shirts https://OurDomain.com.au**/Blue-Shirts**//$1 - it works, BUT....if we redirect another similar category page to different inner page like.... RedirectMatch 301 /category/Blue-Shirts-Size-30 https://OurDomain.com.au****/Blue-Shirts-Size-30****//$1 - it redirects to the first inner page example above. That's why I was assuming it's not working because in the second example the sever sees /Blue-Shirts and ignores everything after it i.e the "Size-30". Hopefully that makes it clearer? 
- 
					
					
					
					
 If I've understood you correctly, all you need to do is to add a tag with the relevant content same as the old one. 
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
- 
		
		
		
		
		
		Should I apply Canonical Links from my Landing Pages to Core Website Pages?
 I am working on an SEO project for the website: https://wave.com.au/ There are some core website pages, which we want to target for organic traffic, like this one: https://wave.com.au/doctors/medical-specialties/anaesthetist-jobs/ Then we have basically have another version that is set up as a landing page and used for CPC campaigns. https://wave.com.au/anaesthetists/ Essentially, my question is should I apply canonical links from the landing page versions to the core website pages (especially if I know they are only utilising them for CPC campaigns) so as to push link equity/juice across? Here is the GA data from January 1 - April 30, 2019 (Behavior > Site Content > All Pages😞 Intermediate & Advanced SEO | | Wavelength_International0
- 
		
		
		
		
		
		Schema markup concerning category pages on an ecommerce site
 We are adding json+ld data to an ecommerce site and myself and one of the other people working on the site are having a minor disagreement on things. What it comes down to is how to mark up the category page. One of us says it needs to be marked up with as an Itempage, https://schema.org/ItemPage The other says it needs to be marked up as products, with multiple product instances in the schema, https://schema.org/Product The main sticking point on the Itemlist is that Itemlist is a child of intangible, so there is a feeling that should be used for things like track listings or other arbitrary data. Intermediate & Advanced SEO | | LesleyPaone2
- 
		
		
		
		
		
		Hacked website - Dealing with 301 redirects and a large .htaccess file
 One of my client's websites was recently hacked and I've been dealing with the after effects of it. The website is now clean of malware and I already appealed to Google about the malware issue. The current issue I have is dealing with the 20, 000+ crawl errors which are garbage links that were created from the hacking. How does one go about dealing with all the 301 redirects I need to create for all the 404 crawl errors? I'm already noticing an increased load time on the website due to having a rather large .htaccess file with a couple thousand 301 redirects done already which I fear will result in my client's website performance and SEO performance taking a hit as well. Intermediate & Advanced SEO | | FPK0
- 
		
		
		
		
		
		Substantial difference between Number of Indexed Pages and Sitemap Pages
 Hey there, I am doing a website audit at the moment. I've notices substantial differences in the number of pages indexed (search console), the number of pages in the sitemap and the number I am getting when I crawl the page with screamingfrog (see below). Would those discrepancies concern you? The website and its rankings seems fine otherwise. Total indexed: 2,360 (Search Consule) Intermediate & Advanced SEO | | Online-Marketing-Guy
 About 2,920 results (Google search "site:example.com")
 Sitemap: 1,229 URLs
 Screemingfrog Spider: 1,352 URLs Cheers,
 Jochen0
- 
		
		
		
		
		
		How to handle individual page redirects on Wix?
 I switched from one domain to another because I wanted a domain that had our company name so it was more brand-y. However, the old domain had better DA/PA. Originally I set up a global 301 from the old to the new, but now I'm finding that I actually need to set up individual 301's from each URL of the old site, or at least from each page. However, I am using Wix so it looks like I can't always do URL-URL 301's, although I can redirect any URL to a page on the new website. The problem is that, in some cases, the content on the new site is different (or, for example, I can only link a particular blog post on the old site back to the new site's blog's main page). How closely do URLS/pages need to resemble each other for link juice to be transferred? Also, should I try to set up all these redirects manually or bite the bullet and go back to using the old domain? The problem is that I did a lot of beginner SEO junk for the new domain, like submitting to a few higher-quality directories, and getting our website on various industry resource sites, etc. I'd need to re-do this entirely if I go back to the old page. What do you think? Intermediate & Advanced SEO | | BohmKalish1230
- 
		
		
		
		
		
		Is it okay to copy and paste on page content into the meta description tag?
 I have heard conflicting answers to this. I always figured that it was okay to selectively copy and paste on page content into the meta description tag.....especially if the onpage content is well written. How can it be duplicate content if it's pulling from the exact same page? Does anybody have any feedback from a credible source about this? Thanks. Intermediate & Advanced SEO | | VanguardCommunications1
- 
		
		
		
		
		
		Blocking Pages Via Robots, Can Images On Those Pages Be Included In Image Search
 Hi! I have pages within my forum where visitors can upload photos. When they upload photos they provide a simple statement about the photo but no real information about the image,definitely not enough for the page to be deemed worthy of being indexed. The industry however is one that really leans on images and having the images in Google Image search is important to us. The url structure is like such: domain.com/community/photos/~username~/picture111111.aspx I wish to block the whole folder from Googlebot to prevent these low quality pages from being added to Google's main SERP results. This would be something like this: User-agent: googlebot Disallow: /community/photos/ Can I disallow Googlebot specifically rather than just using User-agent: * which would then allow googlebot-image to pick up the photos? I plan on configuring a way to add meaningful alt attributes and image names to assist in visibility, but the actual act of blocking the pages and getting the images picked up... Is this possible? Thanks! Leona Intermediate & Advanced SEO | | HD_Leona0
- 
		
		
		
		
		
		Should I Allow Blog Tag Pages to be Indexed?
 I have a wordpress blog with settings currently set so that Google does not index tag pages. Is this a best practice that avoids duplicate content or am I hurting the site by taking eligible pages out of the index? Intermediate & Advanced SEO | | JSOC0
 
			
		 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				