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
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 this3. 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.
-
Hi,
Far from being an htacess expert, but you could also try this rule:
RewriteCond %{REQUEST_URI} /+[^.]+$
RewriteRule ^(.+[^/])$ %{REQUEST_URI}/ [R=301,L](off course I didn't invent it myself - it's coming from here: https://github.com/phanan/htaccess#force-trailing-slash )
I tried it here http://htaccess.madewithlove.be/ - and it seems to work if url is in the form
mydomain.com/article => mydomain.com/article/If you check with mydomain.com/article.htm - it's not redirected
Could be an alternative if the rule proposed by Andy wouldn't work.
Rgds,
Dirk
-
Very welcome and glad it has been of help
-Andy
-
Thanks Andy, i will try this on Tuesday after the bank holiday and see if i can get it working. Either way you have provided a workable solution for me so thanks very much!
-
Have a try of this:
<code>RewriteCond %{REQUEST_URI} !\.(html)$</code>
I think this should work by ignoring anything with .html
Give it a go but if not, you may need to wait for someone else to come and confirm it
-Andy
-
Hmmm slight hic-cup
I just noticed the pages ending
.html
such as category and product pages are now also being given a /
Would you advise just swapping and using the remove / rule or is there an edit to this code so it only happens to page that dont end in .html
-
Perfect. Glad to hear it has helped
-Andy
-
Thanks Andy, it worked a charm and testing doesn't seem to show any errors elseware.
I used the 'enfore a trailing slash' version included in the same article you provided which was
RewriteCond%{REQUEST_FILENAME}!-f
RewriteRule^(.*[^/])$ /$1/[L,R=301]For anybody else thats interested.
-
No need to go with canonicals. A bit of .htaccess code should do it. Pretty sure I got this from Stack Overflow in the past for a client with the same issue:
<code>RewriteCond%{REQUEST_FILENAME}!-d RewriteRule^(.*)/$ /$1 [L,R=301]</code>
Give that a go and let me know how you get on.
Edit - Found the page I was looking for here http://stackoverflow.com/questions/21417263/htaccess-add-remove-trailing-slash-from-url
Cheers,
Andy
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
-
Local SEO - ranking the same page for multiple locations
Hi everyone, I am aware that issue of local SEO has been approached numerous times, but the situation that I'm dealing with is slightly different, so I'd love to receive your expert advice. I'm running the website of a property management company which services multiple locations (www.homevault.com). From our local offices in the city center, we also service neighboring towns and communities ( ex: we have an office in Charlotte NC, from which we service Charlotte plus a dozen other towns nearby). We wanted to avoid creating dozens of extra local service pages, particularly since our offers are identical per metropolitan area and we're talking of 20-30 additional local pages for each area. Instead, we decided to create local service pages only for the main locations. Needless to say, we're now ranking for the main locations, but we're missing on all searches for property management in neighboring towns (we're doing good on searches such as 'charlotte property management', but we're practically invisible for 'davidson property management', although we're searvicing that area as well). What we've done so far to try and fix the situation: 1. The current location pages do include descriptions of areas that we serve. 2. We've included 1-2 keywords for the sattelite locations in the main location pages, but we're nowhere near the optimization needed to rank for local searches in neighboring towns (ie, some main local service pages rank on pages 2-4 for sattelite towns, so not good enough). 3. We've included the searviced areas in our local GMBs, directories, social media profiles etc. None of these solutions appear to work great. Should I go ahead and create the classic local pages for each and every town and optimize them on those particular keywords, even if the offer is practically the same, and the number of pages risks going out of control? Any other better ideas? Many thanks in advance!
Intermediate & Advanced SEO | | HomeVaultPM0 -
Information Architecture/URL Structure of a Consolidated Website
I am working on a project for a company that is going through a major transition. They are deciding to move from a subscription publisher to a digital membership content site. They are ALSO consolidating their sub-brands into one, becoming a branded house. They are a publisher of a niche-hobby, whose base is extremely passionate about the overarching topic. Currently, each sub-brand has its own website with its own branded content. Their new "mega-site" will have all content combined on one domain. Their goal is to appeal to a new user who has overlapping interests in one core topic, while also allowing their existing users and brand loyalists to be able to navigate the site by brand if they want to . If users land on the main domain HP, they will see a simple global navigation where they can navigate the content by topic OR select a brand. Each sub-brand will have it's own sub-navigation. We are currently at the phase where we are working on information architecture and trying to figure out the global nav and the nav for each individual brand. I am A) looking for advice on the best analytics reports to use to help inform navigation decisions and how to categorize content, and B) trying to decide if I should keep the BRANDED content in a sub-folder, or if I should categorize the content by topic and then tag branded content. I'm not concerned about how users will be able to filter the content because that will be easier to figure out. I'm just trying to decide what the main URLs should be when content can be navigated to in multiple ways. Would it be easier to redirect brand1.domain.com > domain.com/brand-1....? Are there benefits to doing it that way?
Intermediate & Advanced SEO | | triveraseo0 -
Google crawling 200 page site thousands of times/day. Why?
Hello all, I'm looking at something a bit wonky for one of the websites I manage. It's similar enough to other websites I manage (built on a template) that I'm surprised to see this issue occurring. The xml sitemap submitted shows Google there are 229 pages on the site. Starting in the beginning of December Google really ramped up their intensity in crawling the site. At its high point Google crawled 13,359 pages in a single day. I mentioned I manage other similar sites - this is a very unusual spike. There are no resources like infinite scroll that auto generates content and would cause Google some grief. So follow up questions to my "why?" is "how is this affecting my SEO efforts?" and "what do I do about it?". I've never encountered this before, but I think limiting my crawl budget would be treating the symptom instead of finding the cure. Any advice is appreciated. Thanks! *edited for grammar.
Intermediate & Advanced SEO | | brettmandoes0 -
URL Parameters Settings in WMT/Search Console
On an large ecommerce site the main navigation links to URLs that include a legacy parameter. The parameter doesn’t actually seem to do anything to change content - it doesn’t narrow or specify content, nor does it currently track sessions. We’ve set the canonical for these URLs to be without the parameter. (We did this when we started seeing that Google was stripping out the parameter in the majority of SERP results themselves.) We’re trying to best strategize on how to set the parameters in WMT (search console). Our options are to set to: 1. No: Doesn’t affect page content’ - and then the Crawl field in WMT is auto-set to ‘Representative URL’. (Note, that it's unclear what ‘Representative URL’ is defined as. Google’s documentation suggests that a representative URL is a canonical URL, and we've specifically set canonicals to be without the parameter so does this contradict? ) OR 2. ‘Yes: Changes, reorders, or narrows page content’ And then it’s a question of how to instruct Googlebot to crawl these pages: 'Let Googlebot decide' OR 'No URLs'. The fundamental issue is whether the parameter settings are an index signal or crawl signal. Google documents them as crawl signals, but if we instruct Google not to crawl our navigation how will it find and pass equity to the canonical URLs? Thoughts? Posted by Susan Schwartz, Kahena Digital staff member
Intermediate & Advanced SEO | | AriNahmani0 -
Best format for E-Commerce Pages in Title Text / Link Text & Markup
Hello Please comment on which you think is best SEO practice for each & any comments on link juice following through. Title text ( on Product Page ) <title>Brandname ProductName</title>
Intermediate & Advanced SEO | | s_EOgi_Bear
OR
<title>ProductName by Brandname</title> on category page <a <span="" class="html-attribute-name">itemprop="name" href="[producturl]">ProductName</a>
<a <span="" class="html-attribute-name">itemprop="brand" href="[brandurl]>BrandName</a> OR <a <span class="html-attribute-name">itemprop="name" href="[producturl]">BrandName ProductName
( Leave Brand Link Out)</a <span> Product Page <a itemprop="name" href="[producturl]">ProductName
<a itemprop="brand" href="[brandurl]>BrandName</a itemprop="brand" href="[brandurl]></a itemprop="name" href="[producturl]"> OR <a itemprop="name" href="[producturl]">BrandName ProductName
( Leave Brand Link Out)</a itemprop="name" href="[producturl]"> Thoughts?0 -
Which is better /section/ or section/index.php?
I have noticed that Google has started to simply link to /section/ as opposed to /section/index.php and I haven't changed any canonical tags etc. I have looked at my pages moz authority for the two /section/ = 28/100
Intermediate & Advanced SEO | | TimHolmes
/section/index.php = 42/100 How would I go about transferring the authority to /section/ from /section/index.php to hopefully help me in my organic serp positions etc. Any insight would be great 🐵0 -
More Indexed Pages than URLs on site.
According to webmaster tools, the number of pages indexed by Google on my site doubled yesterday (gone from 150K to 450K). Usually I would be jumping for joy but now I have more indexed pages than actual pages on my site. I have checked for duplicate URLs pointing to the same product page but can't see any, pagination in category pages doesn't seem to be indexed nor does parameterisation in URLs from advanced filtration. Using the site: operator we get a different result on google.com (450K) to google.co.uk (150K). Anyone got any ideas?
Intermediate & Advanced SEO | | DavidLenehan0 -
Multiple cities/regions websites - duplicate content?
We're about to launch a second site for a different, neighbouring city in which we are going to setup a marketing campaign to target sales in that city (which will also have a separate office there as well). We are going to have it under the same company name, but different domain name and we're going to do our best to re-write the text content as much as possible. We want to avoid Google seeing this as a duplicate site in any way, but what about: the business name the toll free number (which we would like to have same on both sites) the graphics/image files (which we would like to have the same on both sites) site structure, coding styles, other "forensic" items anything I might not be thinking of... How are we best to proceed with this? What about cross-linking the sites?
Intermediate & Advanced SEO | | webdesignbarrie0