URL with .html or not
-
Hello,
I have an online shop for printer consumables
Categories url's are like that https://www.sertit.ro/consumabile-imprimante.html
And products https://www.sertit.ro/cartuse-toner/xerox/cartus-toner-xerox-phaser-3020-workcentre-3025-1500-pagini.html
Is better to have .html or not? -
The decision to include or exclude ".html" extensions in your URLs is generally a matter of personal preference and can depend on your website's technology stack, SEO considerations, and user experience. Both approaches have their advantages, and it's essential to consider how they align with your specific needs. Here are some factors to consider
-
@Sert_Sibiu said in URL with .html or not:
Hello,
I have an online shop for printer consumables
Categories url's are like that https://www.sertit.ro/consumabile-imprimante.html
And products https://www.sertit.ro/cartuse-toner/xerox/cartus-toner-xerox-phaser-3020-workcentre-3025-1500-pagini.html
Is better to have .html or not?Hello,
It's generally better not to have ".html" in your URLs for a cleaner and more modern appearance. Shorter, more user-friendly URLs are easier to remember and share. However, the choice between having ".html" or not won't significantly impact your online shop's functionality or SEO if your website is properly configured. Focus on creating a clear and organized structure for your URLs and providing high-quality content for better results.
.
.
.
(Study abroad) (Masters In Computer Science In Canada ) (Canada PR)(PMP Exam Prep) -
It’s essential to clarify that unless your URLs are exceedingly lengthy, Google won’t discern any difference in how it processes the URL structure. Nonetheless, it’s vital to acknowledge that most individuals don’t retain the ‘.html’ at the end of URLs. So, if they remember the link, that particular segment may elude them. While this confers a minor advantage, it merits consideration. The significance of this aspect is contingent on your situation; if you possess very long URLs, addressing this could be worthwhile, yet it’s imperative to adhere to the guidelines delineated above should you opt for alterations.
Furthermore, remember that it’s feasible to enforce a trailing slash / or opt for no trailing slash. It’s your choice. The paramount concern is ensuring 301 redirects and uniformity in the URLs and reflected accurately across the canonicals, XML sitemap, and the browser. -
Google's preference doesn't lean towards having the ".html" extension in your URLs. While removing it may tidy up the links, the SEO impact is negligible. The removal process is fairly straightforward, depending on your CMS and server setup. Employ regex for creating redirects if you proceed, but ensure to implement 301 redirects to avoid harming your site.
For instance, https://example.com/example-subfolder.html must 301 redirect to https://example.com/example-subfolder/
Decide on enforcing a trailing slash like “example-subfolder/” or removing it "/example-subfolder", aligning this with your rel canonicals and XML sitemap.
General Considerations:
- Maintain URL structure consistency to avert duplicate content issues.
- Always execute 301 redirects for updated URL structures.
- Align your
rel=canonical
tags and XML sitemap with the new URL setup.
Server Configuration:
Apache:
# To force a trailing slash: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^(.*[^/])$ /$1/ [L,R=301] # To remove .html extension: RewriteEngine On RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.html [NC,L]
Nginx:
# To force a trailing slash: rewrite ^([^.]*[^/])$ $1/ permanent; # To remove .html extension: location / { try_files $uri $uri.html $uri/ =404; }
- For Apache, input in
.htaccess
. - For Nginx, input in
nginx.conf
.
WordPress (via Redirection Plugin):
- Install and activate the Redirection Plugin.
- Set up redirects:
- To force a trailing slash:
- Source URL:
/^(.*[^/])$
- Target URL:
/$1/
- Regex: Enabled
- Source URL:
- To remove .html extension:
- Source URL:
/^(.*)\.html$
- Target URL:
/$1
- Regex: Enabled
- Source URL:
- To force a trailing slash:
Canonical and Sitemap Updates:
Before:
<link rel="canonical" href="https://example.com/example-subfolder.html" />
<url> <loc>https://example.com/example-subfolder.html</loc> <lastmod>2023-10-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url>
After (with trailing slash enforced):
<link rel="canonical" href="https://example.com/example-subfolder/" />
<url> <loc>https://example.com/example-subfolder/</loc> <lastmod>2023-10-01</lastmod> <changefreq>monthly</changefreq> <priority>0.8</priority> </url>
-
@educationedge012
Thank you for your reply.
My first consideration is how Google "see" that.
Because the lenght of url's and copy/paste facility. Nobody will remind an URL, in my opinion. -
@Sert_Sibiu said in URL with .html or not:
Hello,
I have an online shop for printer consumables
Categories url's are like that https://www.sertit.ro/consumabile-imprimante.html
And products https://www.sertit.ro/cartuse-toner/xerox/cartus-toner-xerox-phaser-3020-workcentre-3025-1500-pagini.html
Is better to have .html or not?The decision to include or exclude ".html" extensions in your URLs is generally a matter of personal preference and can depend on your website's technology stack, SEO considerations, and user experience. Both approaches have their advantages, and it's essential to consider how they align with your specific needs. Here are some factors to consider:
Advantages of Including ".html" Extensions:
File Type Recognition: Including ".html" in URLs makes it explicit that you're dealing with HTML web pages, which can be beneficial for search engines and browsers.
Historical URLs: If your website has used ".html" extensions in URLs historically, removing them could lead to broken links or issues with existing bookmarks and references.
Static Website: If your website is primarily composed of static HTML files, using ".html" extensions might better represent your content.
Advantages of Excluding ".html" Extensions:
Cleaner URLs: Removing ".html" can make your URLs appear cleaner and more user-friendly, which can enhance the user experience and the aesthetics of your website.
SEO: Search engines generally don't require ".html" to understand the content. Including it doesn't significantly impact SEO rankings, but cleaner URLs can be easier for search engines to understand and index.
Flexibility: Excluding ".html" allows you to switch to different technologies or content types without needing to change your URLs. It provides more flexibility for future site developments.
Ultimately, the decision is up to you. If your website already uses ".html" extensions and changing it would be a significant effort, it might be best to leave it as is. However, if you have the flexibility to make changes, and you prefer cleaner, extension-free URLs, you can consider removing ".html" and implementing proper URL redirects to maintain SEO and user experience. Additionally, ensure that your URL structure is well-optimized for SEO, including relevant keywords, and follows best practices for canonicalization.
Thanks
inovies -
Hello,
Whether to include ".html" in your category and product URLs depends on your website's structure and your personal preferences. Both approaches have their advantages and potential considerations.
Having ".html" in your URLs:
Explicitness: It clearly indicates that the page is in HTML format.
Static URLs: Some users and search engines prefer static URLs, as they can be more descriptive and memorable.
Not having ".html" in your URLs:Cleaner URLs: Removing ".html" can make your URLs look cleaner and more user-friendly.
Easier to change technology: If you ever decide to switch to a different technology or content management system that doesn't use ".html" extensions, it can be a smoother transition.
Ultimately, the decision should be based on your website's structure, your SEO strategy, and what you believe will provide the best user experience. Both options can work effectively if implemented correctly.
(PMP Exam Prep) (PMP Exam ) ( Business Intelligence Analyst Salary) (Study abroad) (Canada PR) -
@Sert_Sibiu Hi, I try not to use ".html" in category and product urls.
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
-
Seeking Advice & Strategies to Boost Rankings and Moz DA/DR
I'm seeking guidance on optimizing the rankings and increasing Moz Domain Authority (DA) and Domain Rating (DR) for my websites, www.fastlanddeals.com and www.fastlandoffer.com, especially in light of the recent Google March 2024 Core Update. What strategies and tactics do you recommend for navigating these changes effectively and enhancing the overall visibility and authority of these domains?
SEO Tactics | | FredericoSeo0 -
Only my homepage ranks for my keywords, should I delete my other pages?
I am an independent artist and all of my business inquiries come through my website (www.ChrisCarlsonArt.com). Over the last 6 months I have been trying to get pages other than my homepage to rank for my keywords, but I haven't made any progress. I worry that I am cannibalizing my keywords since my pages all have similar information. Should I just delete my other pages and focus on ranking my homepage? Also, if I delete my other pages will that have a negative impact on my rankings?
SEO Tactics | | PunchyMcSkeletor0 -
Hi there SEO agency owners
Hi, we are slightly baffled. We have amazing backlinks and good on-site SEO, yet we don’t rank on the first page for our main keyword, “SEO Cardiff.” Now we can't understand why we are not on page one of Google for this keyword? Can someone have a look at our site and tell us why? We think we have better backlinks than some of our direct competitors that rank for this term.
SEO Tactics | | sarahwalsh0 -
how to improve rank
I have a site, can you help me to:
SEO Tactics | | pixou
improve ranking
get high authority backlinks0 -
B2B Marketing
What’s the best way to market a B2B service based business in a local area? Digital Marketing TIA for your input
SEO Tactics | | ExclusiveCS0 -
Multiple URLs from One Domain on Page 1
Is it possible (and if it is possible, how difficult is it) to get multiple URLs from the same domain name to be indexed on the first page of Google for the same keyword or phrase? Assuming each URL has significantly different content of course... Context: A large real estate brand has 6 franchise offices in the same city. Each office has its own listing/landing page on the parent brand website. Each franchise owner wants their page on the website to rank for the term 'Christchurch real estate'. The homepage of the parent brand website currently ranks on the first page of Google for this search term, but none of the franchisee pages do. So my question is: with the right unique content on each franchisee page, supported by quality backlinks to each of the different offices, is it possible to get multiple franchisees listed on the first page of Google given that ultimately the 6 URLs are all attached to the same domain name? (And, if so, do you have any hot tips you can share to assist me on this uphill battle?)
SEO Tactics | | BeKonstructive0 -
How can I make a list of all URLs indexed by Google?
I have a large site with over 6000 pages indexed but only 600 actual pages and need to clean up with 301 redirects. Haven't had this need since Google stopped displaying the url's in the results.
SEO Tactics | | aplusnetsolutions0 -
Spam on Google SEO
Do you know any good tips to reduce spam and if spams have an on google ranking?
SEO Tactics | | easyjobber0