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
-
Is it ok to repeat a (focus) keyword used on a previous page, on a new page?
I am cataloguing the pages on our website in terms of which focus keyword has been used with the page. I've noticed that some pages repeated the same keyword / term. I've heard that it's not really good practice, as it's like telling google conflicting information, as the pages with the same keywords will be competing against each other. Is this correct information? If so, is the alternative to use various long-winded keywords instead? If not, meaning it's ok to repeat the keyword on different pages, is there a maximum recommended number of times that we want to repeat the word? Still new-ish to SEO, so any help is much appreciated! V.
Intermediate & Advanced SEO | | Vitzz1 -
How To Optimize A Page For Multiple Keywords
Hi Guys, In this video by Brian Dean he talks about how to go about optimising for multiple keywords. He basically said the main factors for optimising a page for multiple keywords are the following: Identify other keywords with same search intent as your primary keyword. Add them to title tag strategically, don't stuff them in there. Add as many of those keywords as h2 tags into the content, again when it makes sense. Are there any other more advanced ways you can use to optimize a page for multiple keywords with same search intent that could be good? Any suggestions would be very much appreciated! Cheers.
Intermediate & Advanced SEO | | spyaccounts110 -
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 Errors Help - 350K Page Not Founds in 22 days
Got a good one for you all this time... For our site, Google Search Console is reporting 436,758 "Page Not Found" errors within the Crawl Error report. This is an increase of 350,000 errors in just 22 days (on Sept 21 we had 87,000 errors which was essentially consistently at that number for the previous 4 months or more). Then on August 22nd the errors jumped to 140,000, then climbed steadily from the 26th until the 31st reaching 326,000 errors, and then climbed again slowly from Sept 2nd until today's 436K. Unfortunately I can only see the top 1,000 erroneous URLs in the console, of which they seem to be custom Google tracking URLs my team uses to track our pages. A few questions: 1. Is there anyway to see the full list of 400K URLs Google is reporting they cannot find?
Intermediate & Advanced SEO | | usnseomoz
2. Should we be concerned at all about these?
3. Any other advice? thanks in advance! C0 -
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? www.domain.com/testpage www.domain.com/testpage/ 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 in to the redirected url (http://www.mydomain.com/subdirectory/$1 RewriteCond %{HTTP_HOST} !^www. [NC]
Intermediate & Advanced SEO | | iamgreenminded
RewriteRule ^(.*)$ http://www.mydomain.com/$1 [R=301,L] Trailing slash check Don't fix direct file links RewriteCond %{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]0 -
Does URL format affect Keyword effectiveness for a URL?
I am looking at our site structure, and don't want to have to rebuild the way the site was linked together based on it's current folder structure so I am wondering what option would work better for our URL structure. I will uses car categories as an example of what I am talking about, but you can insert any category structure you like. For example I would like to have pages like this: www.example.com/ford-convertibles
Intermediate & Advanced SEO | | SL_SEM
www.example.com/chevy-convertibles But instead due to the site structure I will need to have pages like this: www.example.com/ford/convertibles
www.example.com/chevy/convertibles But wonder if I shouldn't do the following to ensure the proper phrase is known for the page: www.example.com/ford/ford-convertibles
www.example.com/chevy/chevy-convertibles The "/ford/ford-convertibles" just seems odd to me as a human, but I haven't seen anything on how well a keyphrase in a URL split by /'s does and I know dashes for phrases are fine. This means I am inclined to go with the"/ford/ford-convertibles"style because it keeps the keyphrase separated by dashes even if it is a bit repetitive. There will be other pages too like "/ford/top-10-fords-ever" but I don't wonder about that since it isnt "ford/ford-xxxxx" Thoughts on whether /'s in a keyphrase are as good as dashes?0 -
Skip root page for brandname domain and just forward to key-word URL document?
SEOMoz community, I wanted to get your guys' ideas around what I would consider an unorthodox but potentially effective approach: I am currently internationalizing a brandname domain by building up different CCTLD domains and assigning them to local server resources. In order to push the brand of the project, all international CCTLDs share the same root domain, however the main key word for each CCTLD is different. My question is essentially if it would make sense to configure the root landing page of each international project as http://www.<brandname>.<cctld>/<market_keyword></market_keyword></cctld></brandname> rather than the typical approach http://www.<brandname>.</brandname> This would allow me to get the market specific keyword into the landing page URL. The root domain would have a 301 redirect to the keyword landing page. Anyone has any experience with this approach? Does a true root domain URL get some sort of SEO bonus that would not justify the above approach or will the URL with the keyword in the path will have higher SEO power. Looking forward to your responses - even if its just projections/SEO gut feeling. Thanks /Thomas
Intermediate & Advanced SEO | | tomypro0 -
WWW vs Non-WWW/Moving a site to a new CMS/Redirect all of the previous URLs
We are working on a new design for a website, which is currently on a CMS that has non-seo-friendly URLs. There is no redirection of 'www' to non-www or vice versa, or handling of homepage redirection so there is only one instance of 'home'. To move the site in the future, all of these URLs will have to be redirected to their new, and I hope, seo-friendly counterparts. Is it prudent now to redirect the four home page links so there is only one? and to redirect all non-www to 'www' so there is only one instance of each page? Or should I leave it and redirect all of them when the time comes?
Intermediate & Advanced SEO | | haan_seo0