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
- 
		
		
		
		
		
		Duplicate Content through 'Gclid'
 Hello, We've had the known problem of duplicate content through the gclid parameter caused by Google Adwords. As per Google's recommendation - we added the canonical tag to every page on our site so when the bot came to each page they would go 'Ah-ha, this is the original page'. We also added the paramter to the URL parameters in Google Wemaster Tools. However, now it seems as though a canonical is automatically been given to these newly created gclid pages; below https://www.google.com.au/search?espv=2&q=site%3Awww.mypetwarehouse.com.au+inurl%3Agclid&oq=site%3A&gs_l=serp.3.0.35i39l2j0i67l4j0i10j0i67j0j0i131.58677.61871.0.63823.11.8.3.0.0.0.208.930.0j3j2.5.0....0...1c.1.64.serp..8.3.419.nUJod6dYZmI Therefore these new pages are now being indexed, causing duplicate content. Does anyone have any idea about what to do in this situation? Thanks, Stephen. Intermediate & Advanced SEO | | MyPetWarehouse0
- 
		
		
		
		
		
		Duplicate content on recruitment website
 Hi everyone, It seems that Panda 4.2 has hit some industries more than others. I just started working on a website, that has no manual action, but the organic traffic has dropped massively in the last few months. Their external linking profile seems to be fine, but I suspect usability issues, especially the duplication may be the reason. The website is a recruitment website in a specific industry only. However, they posts jobs for their clients, that can be very similar, and in the same time they can have 20 jobs with the same title and very similar job descriptions. The website currently have over 200 pages with potential duplicate content. Additionally, these jobs get posted on job portals, with the same content (Happens automatically through a feed). The questions here are: How bad would this be for the website usability, and would it be the reason the traffic went down? Is this the affect of Panda 4.2 that is still rolling What can be done to resolve these issues? Thank you in advance. Intermediate & Advanced SEO | | iQi0
- 
		
		
		
		
		
		How do I get rel='canonical' to eliminate the trailing slash on my home page??
 I have been searching high and low. Please help if you can, and thank you if you spend the time reading this. I think this issue may be affecting most pages. SUMMARY: I want to eliminate the trailing slash that is appended to my website. SPECIFIC ISSUE: I want www.threewaystoharems.com to showing up to users and search engines without the trailing slash but try as I might it shows up like www.threewaystoharems.com/ which is the canonical link. WHY? and I'm concerned my back-links to the link without the trailing slash will not be recognized but most people are going to backlink me without a trailing slash. I don't want to loose linkjuice from the people and the search engines not being in consensus about what my page address is. THINGS I"VE TRIED: (1) I've gone in my wordpress settings under permalinks and tried to specify no trailing slash. I can do this here but not for the home page. (2) I've tried using the SEO by yoast to set the canonical page. This would work if I had a static front page, but my front page is of blog posts and so there is no advanced page settings to set the canonical tag. (3) I'd like to just find the source code of the home page, but because it is CSS, I don't know where to find the reference. I have gone into the css files of my wordpress theme looking in header and index and everywhere else looking for a specification of what the canonical page is. I am not able to find it. I'm thinking it is actually specified in the .htaccess file. (4) Went into cpanel file manager looking for files that contain Canonical. I only found a file called canonical.php . the only thing that seemed like it was worth changing was changing line 139 from $redirect_url = home_url('/'); to $redirect_url = home_url(''); nothing happened. I'm thinking it is actually specified in the .htaccess file. (5) I have gone through the .htaccess file and put thes 4 lines at the top (didn't redirect or create the proper canonical link) and then at the bottom of the file (also didn't redirect or create the proper canonical link) : RewriteEngine on Intermediate & Advanced SEO | | Dillman
 RewriteCond %{HTTP_HOST} ^([a-z.]+)?threewaystoharems.com$ [NC]
 RewriteCond %{HTTP_HOST} !^www. [NC]
 RewriteRule .? http://www.%1threewaystoharems.com%{REQUEST_URI} [R=301,L] Please help friends.0
- 
		
		
		
		
		
		Tabs and duplicate content?
 We own this site http://www.discountstickerprinting.co.uk/ and just a little concerned as I right clicked open in new tab on the tab content section and it went to a new page For example if you right click on the price tab and click open in new tab you will end up with the url Intermediate & Advanced SEO | | BobAnderson
 http://www.discountstickerprinting.co.uk/#tabThree Does this mean that our content is being duplicated onto another page? If so what should I do?0
- 
		
		
		
		
		
		Duplicate content on sites from different countries
 Hi, we have a client who currently has a lot of duplicate content with their UK and US website. Both websites are geographically targeted (via google webmaster tools) to their specific location and have the appropriate local domain extension. Is having duplicate content a major issue, since they are in two different countries and geographic regions of the world? Any statement from Google about this? Regards, Bill Intermediate & Advanced SEO | | MBASydney0
- 
		
		
		
		
		
		International SEO - cannibalisation and duplicate content
 Hello all, I look after (in house) 3 domains for one niche travel business across three TLDs: .com .com.au and co.uk and a fourth domain on a co.nz TLD which was recently removed from Googles index. Symptoms: For the past 12 months we have been experiencing canibalisation in the SERPs (namely .com.au being rendered in .com) and Panda related ranking devaluations between our .com site and com.au site. Around 12 months ago the .com TLD was hit hard (80% drop in target KWs) by Panda (probably) and we began to action the below changes. Around 6 weeks ago our .com TLD saw big overnight increases in rankings (to date a 70% averaged increase). However, almost to the same percentage we saw in the .com TLD we suffered significant drops in our .com.au rankings. Basically Google seemed to switch its attention from .com TLD to the .com.au TLD. Note: Each TLD is over 6 years old, we've never proactively gone after links (Penguin) and have always aimed for quality in an often spammy industry. **Have done: ** Adding HREF LANG markup to all pages on all domain Each TLD uses local vernacular e.g for the .com site is American Each TLD has pricing in the regional currency Each TLD has details of the respective local offices, the copy references the lacation, we have significant press coverage in each country like The Guardian for our .co.uk site and Sydney Morning Herlad for our Australia site Targeting each site to its respective market in WMT Each TLDs core-pages (within 3 clicks of the primary nav) are 100% unique We're continuing to re-write and publish unique content to each TLD on a weekly basis As the .co.nz site drove such little traffic re-wrting we added no-idex and the TLD has almost compelte dissapread (16% of pages remain) from the SERPs. XML sitemaps Google + profile for each TLD **Have not done: ** Hosted each TLD on a local server Around 600 pages per TLD are duplicated across all TLDs (roughly 50% of all content). These are way down the IA but still duplicated. Images/video sources from local servers Added address and contact details using SCHEMA markup Any help, advice or just validation on this subject would be appreciated! Kian Intermediate & Advanced SEO | | team_tic1
- 
		
		
		
		
		
		Could you use a robots.txt file to disalow a duplicate content page from being crawled?
 A website has duplicate content pages to make it easier for users to find the information from a couple spots in the site navigation. Site owner would like to keep it this way without hurting SEO. I've thought of using the robots.txt file to disallow search engines from crawling one of the pages. Would you think this is a workable/acceptable solution? Intermediate & Advanced SEO | | gregelwell0
- 
		
		
		
		
		
		Multiple URLs for the same page
 I am working with a client and recently discovered that they have several URLs that go to the same page. http://www.maps.com/FunFacts.aspx Intermediate & Advanced SEO | | WebMarketingandDesign
 http://www.maps.com/funfacts.aspx
 http://www.maps.com/FunFacts.aspx?nav=FF
 http://www.maps.com/FunFacts.aspx?nav=FS
 http://www.maps.com/funfacts.aspx?nav=FF
 http://www.maps.com/funfacts.aspx?nav=ffhttp://www.maps.com/FunFacts.aspx?nav=MShttp://www.maps.com/funfacts.aspx?nav=
 http://www.maps.com/FunFacts.aspx?nav=FF#
 http://www.maps.com/FunFacts
 http://www.maps.com/funfacts.aspx?.nav=FF I am afraid this is happening all over the site. So, my question is: Is this hurting the SEO and how? If so what is the best way to go about fixing this problem? Thanks for your help!0
 
			
		 
			
		 
					
				 
					
				 
					
				 
					
				 
					
				 
					
				