Hi,
I have 2 question that I am really struggling with...
A). How do you create a 'flat url' for example: example.com/example/ rather than having: example.com/example.html
B). Does this help SEO?
Thanks.
Welcome to SEOChat, a community dedicated to helping beginners and professionals alike in improving their Search Engine Optimization knowledge. Sign up today to gain access to the combined insight of tens of thousands of members.
Hi,
I have 2 question that I am really struggling with...
A). How do you create a 'flat url' for example: example.com/example/ rather than having: example.com/example.html
B). Does this help SEO?
Thanks.
A. You would create a sub folder of your website and create an index.html in that sub folder. That would allow you to link to example.com/example which would be the same as example.com/example/index.html
B. This doesn't really affect SEO in any way. Unless you want to segregate your linking strategies. For example you link relevant content to example.com/dogs and link other relevant content to example.com/cats. Then it could help.
Creating a subfolder for this task is a HORRIBLE idea.
Just use your htaccess:
With .htaccess under apache you can do the redirect like this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)\.html$ /$1 [L,R=301]
As for removing of .html from the url, simply link to the page without .html
<a href="http://www.example.com/page">page</a>
Source: .htaccess - How to remove .html from URL - Stack Overflow
There's no benefit in an SEO value. Your URL's just look cleaner. Personally, I like the extensions, but it's all preference.
Last edited by joshz; Jan 24th, 2013 at 08:48 AM.
www.V2INTERACTIVE.net - SEO Web Design | On-Page SEO | SEO Audits & Reports | Link Building
BASED IN ATLANTA, GA. Contact: Skype/Phone/Email (Discounted rates available for SEOChat members only - email seochat@v2interactive.net)
Please EMAIL me at the above address and do not send Private Messages. I rarely check them and your message will be lost.
You ask if a flat url like domain.com/page helps in SEO?
No, it actually complicates it.Shocked?
Now domain.com/page and domain.com/page/ might create duplication issues.
some times if not properly handled it may lead to "404 not found errors".
But if a rel=canonical tag is set and htaccess is properly handled flat URLs are far more cooler than domain.com/page.html
SEO Professionals in NewDelhi Its Different. Dont believe me? Go check yourself.![]()
I haven't used the above that Josh share, but this one works as its what I use on a couple of my sites:
And no it will make no difference to your seo, usability or anything as search engines, servers and humans don't care about what extension your site is or isn't using. The extension is simply needed on the file so your web server knows how to process the information on the page.Code:# Rewrite .php to extensionless URL: RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^([^\.]+)$ $1.php [NC,L]
Its the same as your PC, you can tell it to hid or display your file type under your folder and search options, which makes no difference to how your PC works or what you think of the files you want to open.
New To SEOChat? See Here & the FAQ's
"stupid people say stupid things, and smart people out smart each other!" SOAD
301 Redirects | SEO Tools | Default htaccess
Nathanel,
The code you shared does not do what the OP wanted to be done.
Your code re-writes domain.com/page to domain.com/page.php
We are talking about .html here. So Josh's code seems fine to me.
Ok folks, thanks! I really appreciate the info! Wow! :-)
I would add that domain.com/page and domain.com/page/ are not the same.
One is a request for a file called page
The other is a request for a directory called page.
On just about every web server, when you request a directory you get a directory index file served and that is nearly always a cascade of index.html, index.php etc.
You do have to be careful that you get the correct response codes as mentioned.
A further note on URLs - basically if you can request a file from any URL and it returns the same HTML code then it doesn't make much difference. There are some goofy things that can be done to confuse this issue but essentially its a pretty insignificant thing.
Become Part of This Conversation
Join NowFor Free!
Comments on this post