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
-
How to rank for a location/country without having a physical address in that location/country
How do I go about it if my physical address (office) is in Country A but I want to rank my website in Country B, C and D (without having an office or physical address in the countries B, C and D)? I am aware of people setting up virtual offices in other countries/cities and adding them to Google Places/Maps with toll free phone numbers, but I don't wish to do any of that. I know Google will catch up with this one day or the other and punish me hard for trying to play games with it. Is there a way rank a website in another country without actually having a physical location there? If yes, please guide me how to go about it.
Intermediate & Advanced SEO | | KS__0 -
Possible to Improve Domain Authority By Improving Content on Low Page Rank Pages?
My sites domain authority is only 23. The home page has a page authority of 32. My site consists of about 400 pages. The topic of the site is commercial real estate (I am a real estate broker). A number of the sites we compete against have a domain authority of 30-40. Would our overall domain authority improved if we re-wrote the content for several hundred of pages that had the lowest page authority (say 12-15)? Is the overall domain authority derived by an average of the page authority of each page on a domain? Alternatively could we increase domain authority by setting the pages with the lowest page authority to "no index". By the way our domain is www.nyc-officespace-leader.com Thanks, Alan
Intermediate & Advanced SEO | | Kingalan10 -
Help with https// redirects
Hey there
Intermediate & Advanced SEO | | Jay328
I have a client who just moved from a self hosted CMS to Adobe Catalyst (don't ask!)
The problem: Their url indexed with google is https://domain.com, Adobe Catalyst does not support third party SSL certificates or https domains. Now when people google them https://domain.com shows up in search, HOWEVER it does not have a trusted certificate and a pop up window blocks the site. They are a mortgage company so SSL is really not needed. What can I do to get google to recognize the site at http: vs. https? Would this be something in GWMT? Thanks!0 -
Does Google throttle back the search performance of a penalised website/page after the penalty has been removed?
Hi Mozzers. Back in 2013 my website www.octopus-hr.co.uk was hit by a Penguin 2.0 penalty owing to a harmful backlink profile built by a dodgy SEO consultant (now fired). The penalty seemed to apply to the homepage of the site but other pages were unaffected. We got what links we could removed, disavowed the rest and were informed in September 2013 that the penalty had been removed and our re-inclusion request had been successful. However our website homepage still ranks poorly for the search terms we're targeting in the UK: "HR Software" "HR Systems" On page factors are in my opinion pretty well optimised for these search terms. In terms of link building post penalty we've focused on high authority and relevant sites. I believe that compared to most of our search competitors the back link profile to our homepage is in pretty good shape, however it still ranks badly. Has anyone had any experience of a penalty hangover from Google in the past? Are there other things I should consider? Thanks David
Intermediate & Advanced SEO | | OctopusHR0 -
How to avoid content canibalizm? How do I control which page is the landing page?
Hi All, To clarify my question I will give an example. Let's assume that I have a laptop e-commerce site and that one of my main categories is Samsung Laptops. The category page shows lots of laptops and a small section of text. On the other hand, in my article section I have a HUGE article about Samsung Laptops. If we consider the two word phrases each page is targeting then the answer is the same - Samsung Laptops. On the article i point to the category page using anchor such as "buy samsung laptops" or "samsung laptops" and on the category page (my wishful landing page) I point to the article with "learn about samsung laptops" or "samsung laptops pros and cons". Thanks
Intermediate & Advanced SEO | | BeytzNet0 -
URL Going Over the Last Page of Pagination - Post Webinar Discussion
**Discussion Question: **Lets say you have 33 pages of paginated content but someone lands on page 34+, what do you do? I just setup a variable on my site so when someone lands on a page that is over the page count they are redirected to the last page of the paginated content. My reasoning is the user is looking for the last page, so why not redirect them to it? Now I just saw in the latest webinar on ecommerce (by Everett Sizemore) that he recommends a 404… should I switch? Why a 404? Again, what do you guys do when you encounter this situation?
Intermediate & Advanced SEO | | BeTheBoss0 -
Should I build links to the home page or a url containing the keyword?
I run an IT company and the company name does not contain the key word I am trying to rank on. I also have a bunch of pages with page rank that containing the actual keywords, for example: http://www.mycompanyname.com/tech-support/locations/brighton My target keyword is "Tech Support Brighton" My Home page is PR4 and my location based pages are PR3. My plan was to build 3 or 4 location pages for the locations we provide tech support for and target location based keyword Anchor text to these URL's e.g "Tech Support Brighton" and then for the home page build links that have the anchor text "Tech Support". Does this sound sane? Many Thanks, K
Intermediate & Advanced SEO | | SEOKeith0 -
URL Length or Exact Breadcrumb Navigation URL? What's More Important
Basically my question is as follows, what's better: www.romancingdiamonds.com/gemstone-rings/amethyst-rings/purple-amethyst-ring-14k-white-gold (this would fully match the breadcrumbs). or www.romancingdiamonds.com/amethyst-rings/purple-amethyst-ring-14k-white-gold (cutting out the first level folder to keep the url shorter and the important keywords are closer to the root domain). In this question http://www.seomoz.org/qa/discuss/37982/url-length-vs-url-keywords I was consulted to drop a folder in my url because it may be to long. That's why I'm hesitant to keep the bradcrumb structure the same. To the best of your knowldege do you think it's best to drop a folder in the URL to keep it shorter and sweeter, or to have a longer URL and have it match the breadcrumb structure? Please advise, Shawn
Intermediate & Advanced SEO | | Romancing0