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.
Trailing Slashes for Magento CMS pages - 2 URLS - Duplicate content
- 
					
					
					
					
 Hello, Can anyone help me find a solution to Fixing and Creating Magento CMS pages to only use one URL and not two URLS? I found a previous article that applies to my issue, which is using htaccess to redirect request for pages in magento 301 redirect to slash URL from the non-slash URL. I dont understand the syntax fully in htaccess , but I used this code below. This code below fixed the CMS page redirection but caused issues on other pages, like all my categories and products with this error: "This webpage has a redirect loop ERR_TOO_MANY_REDIRECTS" Assuming you're running at domain root. Change to working directory if needed.RewriteBase / # www check If you're running in a subdirectory, then you'll need to add that into the redirected url (http://www.mydomain.com/subdirectory/$1RewriteCond %{HTTP_HOST} !^www. [NC] 
 RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L]Trailing slash checkDon't fix direct file linksRewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_URI} !(.)/$ 
 RewriteRule ^(.)$ $1/ [L,R=301]Finally, forward everything to your front-controller (index.php)RewriteCond %{REQUEST_FILENAME} !-f 
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteRule .* index.php [QSA,L]
- 
					
					
					
					
 301's are not difficult for me, but handling the code for a logic to re-route requests for "URL" to "URL/" is something I dont know how to do. I can manually 301 or rel canonical my CMS pages on Magento everytime, but that defeats the purpose or the automation in htaccess I am trying to get working. thanks 
- 
					
					
					
					
 Thank You Kevin. This is almost the default Magento htaccess file(out of the box), I think I had a couple entries to fix a couple other issues, the code I just added that isnt working is in the middle of the htaccess, its commented starting with this: ** "## slash removal re-write done by ALEX MEADE for iamgreenminded.com** uncomment these lines for CGI modemake sure to specify the correct cgi php binary file nameit might be /cgi-bin/php-cgiAction php5-cgi /cgi-bin/php5-cgiAddHandler php5-cgi .php############################################ GoDaddy specific optionsOptions -MultiViewsyou might also need to add this line to php.inicgi.fix_pathinfo = 1if it still doesn't work, rename php.ini to php5.ini############################################ this line is specific for 1and1 hosting#AddType x-mapp-php5 .php 
 #AddHandler x-mapp-php5 .php############################################ default index fileDirectoryIndex index.php ############################################ adjust memory limitphp_value memory_limit 64Mphp_value memory_limit 256M 
 php_value max_execution_time 18000############################################ disable magic quotes for php request varsphp_flag magic_quotes_gpc off ############################################ disable automatic session startbefore autoload was initializedphp_flag session.auto_start off ############################################ enable resulting html compression#php_flag zlib.output_compression on ########################################### disable user agent verification to not break multiple image uploadphp_flag suhosin.session.cryptua off ########################################### turn off compatibility with PHP4 when dealing with objectsphp_flag zend.ze1_compatibility_mode Off <ifmodule mod_security.c="">########################################### disable POST processing to not break multiple image upload</ifmodule>SecFilterEngine Off 
 SecFilterScanPOST Off############################################ enable apache served files compressionhttp://developer.yahoo.com/performance/rules.html#gzipInsert filter on all content###SetOutputFilter DEFLATE Insert filter on selected content types only#AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css text/javascript Netscape 4.x has some problems...#BrowserMatch ^Mozilla/4 gzip-only-text/html Netscape 4.06-4.08 have some more problems#BrowserMatch ^Mozilla/4.0[678] no-gzip MSIE masquerades as Netscape, but it is fine#BrowserMatch \bMSIE !no-gzip !gzip-only-text/html Don't compress images#SetEnvIfNoCase Request_URI .(?:gif|jpe?g|png)$ no-gzip dont-vary Make sure proxies don't deliver the wrong content#Header append Vary User-Agent env=!dont-vary ############################################ make HTTPS env vars available for CGI modeSSLOptions StdEnvVars ############################################ enable rewritesOptions +FollowSymLinks 
 RewriteEngine on############################################ slash removal re-write done by ALEX MEADE for iamgreenminded.comRewriteBase / 
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_URI} !(.)/$
 RewriteCond %{REQUEST_FILENAME} !.(gif|jpg|png|jpeg|css|js)$ [NC]
 RewriteRule ^(.)$ http://%{HTTP_HOST}/$1/ [L,R=301]
 ######################################################################################## you can put here your magento root folderpath relative to web root#RewriteBase /magento/ ############################################ uncomment next line to enable light API calls processingRewriteRule ^api/([a-z][0-9a-z_]+)/?$ api.php?type=$1 [QSA,L]############################################ rewrite API2 calls to api.php (by now it is REST only)RewriteRule ^api/rest api.php?type=rest [QSA,L] ############################################ workaround for HTTP authorizationin CGI environmentRewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}] ############################################ TRACE and TRACK HTTP methods disabled to prevent XSS attacksRewriteCond %{REQUEST_METHOD} ^TRAC[EK] 
 RewriteRule .* - [L,R=405]############################################ redirect for mobile user agents#RewriteCond %{REQUEST_URI} !^/mobiledirectoryhere/.$ 
 #RewriteCond %{HTTP_USER_AGENT} "android|blackberry|ipad|iphone|ipod|iemobile|opera mobile|palmos|webos|googlebot-mobile" [NC]
 #RewriteRule ^(.)$ /mobiledirectoryhere/ [L,R=302]############################################ always send 404 on missing files in these foldersRewriteCond %{REQUEST_URI} !^/(media|skin|js)/ ############################################ never rewrite for existing files, directories and linksRewriteCond %{REQUEST_FILENAME} !-f 
 RewriteCond %{REQUEST_FILENAME} !-d
 RewriteCond %{REQUEST_FILENAME} !-l############################################ rewrite everything else to index.phpRewriteRule .* index.php [L] ############################################ Prevent character encoding issues from server overridesIf you still have problems, use the second line insteadAddDefaultCharset Off 
 #AddDefaultCharset UTF-8############################################ Add default Expires headerhttp://developer.yahoo.com/performance/rules.html#expiresExpiresDefault "access plus 1 year" ############################################ By default allow all accessOrder allow,deny 
 Allow from all########################################### Deny access to release notes to prevent disclosure of the installed Magento version<files release_notes.txt="">order allow,deny 
 deny from all</files>############################################ If running in cluster environment, uncomment thishttp://developer.yahoo.com/performance/rules.html#etags#FileETag none Permanent URL redirect - generated by www.rapidtables.comRedirect 301 /thebirdword http://www.thebirdword.com 
- 
					
					
					
					
 You probably have other redirects in your .htaccess and possibly in your website code. The order of your rewrites is also important. Publish your Apache config and I'll take a look. FYI, there are better resources for technical issue than MOZ. Most here are not developers/IT specialists; we're more like SEO strategists and business managers. 
- 
					
					
					
					
 RewriteEngine On 
 RewriteBase /
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteCond %{REQUEST_URI} !example.php
 RewriteCond %{REQUEST_URI} !(.)/$
 RewriteRule ^(.)$ http://domain.com/$1/ [L,R=301]I have found both of the articles you linked here, nothing is working - any code I try gives me the same error on most of my pages: "This webpage has a redirect loop ERR_TOO_MANY_REDIRECTS" Still need a fix for this thanks 
- 
					
					
					
					
 Yes, server redirects are necessary. Try these solutions to see which one works for you: http://ralphvanderpauw.com/seo/how-to-301-redirect-a-trailing-slash-in-htaccess/ http://enarion.net/web/htaccess/trailing-slash/ You might want to consider moving to Nginx. You'll notice amazing speed and stability improvement with Nginx, Redis Session Cache, Memcached, OpCache, Ngx_pagespeed, and Magento Cache Storage Management. I can help much more with Nginx redirects and conf files--I gave up Apache years ago. Sorry I couldn't be of more help. 
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
- 
		
		
		
		
		
		Removing the Trailing Slash in Magento
 Hi guys, We have noticed trailing slash vs non-trailing slash duplication on one of our sites. Example: Intermediate & Advanced SEO | | brandonegroup
 Duplicate: https://www.example.com.au/living/
 Preferred: https://www.example.com.au/living So, SEO-wise, we suggested placing a canonical tag on all trailing slash pointing to non-trailing slash. However, devs have advised against removing the trailing slash from some URLs with a blanket rule, as this may break functionality in Magento that depends on the trailing slash. The full site would need to be tested after implementing a blanket rewrite rule. Is any other way to address this trailing slash duplication issue without breaking anything in Magento? Keen to hear from you guys. Cheers,0
- 
		
		
		
		
		
		Directory with Duplicate content? what to do?
 Moz keeps finding loads of pages with duplicate content on my website. The problem is its a directory page to different locations. E.g if we were a clothes shop we would be listing our locations: www.sitename.com/locations/london www.sitename.com/locations/rome www.sitename.com/locations/germany The content on these pages is all the same, except for an embedded google map that shows the location of the place. The problem is that google thinks all these pages are duplicated content. Should i set a canonical link on every single page saying that www.sitename.com/locations/london is the main page? I don't know if i can use canonical links because the page content isn't identical because of the embedded map. Help would be appreciated. Thanks. Intermediate & Advanced SEO | | nchlondon0
- 
		
		
		
		
		
		Duplicate content on URL trailing slash
 Hello, Some time ago, we accidentally made changes to our site which modified the way urls in links are generated. At once, trailing slashes were added to many urls (only in links). Links that used to send to Intermediate & Advanced SEO | | yacpro13
 example.com/webpage.html Were now linking to
 example.com/webpage.html/ Urls in the xml sitemap remained unchanged (no trailing slash). We started noticing duplicate content (because our site renders the same page with or without the trailing shash). We corrected the problematic php url function so that now, all links on the site link to a url without trailing slash. However, Google had time to index these pages. Is implementing 301 redirects required in this case?1
- 
		
		
		
		
		
		Magento Trailing Slash URL Problem
 Howdy Mozzers! Our magento store URL's are accessible with or without a trailing slash at the end. Canonical's and 301 redirects are not set up for one of them at the moment. Will this cause duplicate issue? Do we need to set canonical or 301 up? Which one is recommended? MozAddict Intermediate & Advanced SEO | | MozAddict0
- 
		
		
		
		
		
		Partial duplicate content and canonical tags
 Hi - I am rebuilding a consumer website, and each product page will contain a unique product image, and a sentence or two about the product (and we tend to use a lot of the same words in different ways across products). I'd like to have a tabbed area below the product info that talks about the overall product line, and this content would be duplicate across all the product pages (a "Why use our products" type of thing). I'd have this duplicate content also living on its own URL's so they can be found alone in the SERP's. Question is, do I need to add the canonical tag to this page, since there's partial duplicate content on the product pages? And if I did that, would my product pages go un-indexed?? I understand how to handle completely duplicated content, it's the partial duplicate that I'm having difficulty figuring out. Intermediate & Advanced SEO | | Jenny10
- 
		
		
		
		
		
		Artist Bios on Multiple Pages: Duplicate Content or not?
 I am currently working on an eComm site for a company that sells art prints. On each print's page, there is a bio about the artist followed by a couple of paragraphs about the print. My concern is that some artists have hundreds of prints on this site, and the bio is reprinted on every page,which makes sense from a usability standpoint, but I am concerned that it will trigger a duplicate content penalty from Google. Some people are trying to convince me that Google won't penalize for this content, since the intent is not to game the SERPs. However, I'm not confident that this isn't being penalized already, or that it won't be in the near future. Because it is just a section of text that is duplicated, but the rest of the text on each page is original, I can't use the rel=canonical tag. I've thought about putting each artist bio into a graphic, but that is a huge undertaking, and not the most elegant solution. Could I put the bio on a separate page with only the artist's info and then place that data on each print page using an <iframe>and then put a noindex,nofollow in the robots.txt file?</p> <p>Is there a better solution? Is this effort even necessary?</p> <p>Thoughts?</p></iframe> Intermediate & Advanced SEO | | sbaylor0
- 
		
		
		
		
		
		Capitals in url creates duplicate content?
 Hey Guys, I had a quick look around however I couldn't find a specific answer to this. Currently, the SEOmoz tools come back and show a heap of duplicate content on my site. And there's a fair bit of it. However, a heap of those errors are relating to random capitals in the urls. for example. "www.website.com.au/Home/information/Stuff" is being treated as duplicate content of "www.website.com.au/home/information/stuff" (Note the difference in capitals). Anyone have any recommendations as to how to fix this server side(keeping in mind it's not practical or possible to fix all of these links) or to tell Google to ignore the capitalisation? Any help is greatly appreciated. LM. Intermediate & Advanced SEO | | CarlS0
- 
		
		
		
		
		
		How to resolve Duplicate Page Content issue for root domain & index.html?
 SEOMoz returns a Duplicate Page Content error for a website's index page, with both domain.com and domain.com/index.html isted seperately. We had a rewrite in the htacess file, but for some reason this has not had an impact and we have since removed it. What's the best way (in an HTML website) to ensure all index.html links are automatically redirected to the root domain and these aren't seen as two separate pages? Intermediate & Advanced SEO | | ContentWriterMicky0
 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				