Extensionless URLs
Extensionless URLs
Not exactly a Webbuilder Extension, but a tool to remove the .html extension from the internal links on your published pages, providing links to extensionless URLs
What are extensionless URL's?
Extensionless URL's are URL's that do not have the (in this case) .html extension. For example, http://mywebsite/us/products.html becomes http://mywebsite/us/products
For more info see: http://rjsoft.net/us/extensionless
What are extensionless URL's?
Extensionless URL's are URL's that do not have the (in this case) .html extension. For example, http://mywebsite/us/products.html becomes http://mywebsite/us/products
For more info see: http://rjsoft.net/us/extensionless
Last edited by GerardF on Wed Aug 05, 2015 7:12 am, edited 1 time in total.
Re: Extensionless URLs
This is very clever and seems easy to use. I shall give it a try and see... Well done.
Running WYSIWYG Web Builder since 2007...
Re: Extensionless URLs
GerardF,
Extention if it works is useful. Have you removed the pages from your server? It redirects to 1&1 main page. Changing/shortening file names may be confusing at times and cause errors. Also one must be careful adding trailing hash at the end of the www address. At that point, given www addresses results in redirection/error. It can also be done via .htaccess file in main website folder by adding lines:
PHP EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
HTML EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
Please verify it. Thanks.
Extention if it works is useful. Have you removed the pages from your server? It redirects to 1&1 main page. Changing/shortening file names may be confusing at times and cause errors. Also one must be careful adding trailing hash at the end of the www address. At that point, given www addresses results in redirection/error. It can also be done via .htaccess file in main website folder by adding lines:
PHP EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
HTML EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
Please verify it. Thanks.
Last edited by tommy888 on Tue Aug 04, 2015 10:16 am, edited 1 time in total.
Re: Extensionless URLs
I don't say it doesn't work. I only mentioned the url addresses given are redirected to 1&1 home page or produce an error.
Re: Extensionless URLs
Hello Tommy888
I'm sorry, exactly what url addresses are you referring to?
I'm sorry, exactly what url addresses are you referring to?
Re: Extensionless URLs
The ones you mentioned as examples: http://mywebsite/us/products.html
Probably you no longer host pages there.
Probably you no longer host pages there.
- BaconFries
-
- Posts: 5371
- Joined: Thu Aug 16, 2007 7:32 pm
Re: Extensionless URLs
This was just used as an example ....the op writes this in his original post.
Re: Extensionless URLs
I thought so BaconFries but they are actually links so it may be confusing a bit.
Re: Extensionless URLs
You should bear in mind that when path names are altered, sitemap must also be changed and best delivered to Google Webmaster Tools by uploading current sitemap.xml as soon as possible otherwise users get an error message.
Last edited by tommy888 on Wed Aug 05, 2015 9:52 pm, edited 1 time in total.
Re: Extensionless URLs
Ah, I understand the confusion. The links are indeed given as an example and are not real existing links.
I thought it would be obvious that the domain 'mywebsite' does not exist, but apparently I thought wrong
I thought it would be obvious that the domain 'mywebsite' does not exist, but apparently I thought wrong
You are right, the tool can do this by checking the 'Include sitemap.xml' option.You should bear in mind that when path names are altered, sitemap must also be changed
- vijayaraghavan.r
-
- Posts: 15
- Joined: Mon Nov 01, 2010 4:51 pm
Re: Extensionless URLs
I am not a techie. For the last few months, "htaccess for extensionless URL" has put me into lots of challenges with time consuming references, try different codes, checking root directory for files, auto-write htaccess codes, and so on. Pablo is a wonderful person who has given fantastic hints about the .htaccess code and hide for extension option in Preview & Publish. I will share my experience. After many references, I had almost given up.
Yet, I went into this File>Options>Publish & Preview>Links (for advanced users only). From here, I went to Help mode, as he directed. Without any negligence, I went to help mode and checked. There, I found this.
WARNING:
The generated files will still have extensions otherwise they will not be recognized as HTML/PHP files on the server!
So this means that internal links will no longer work unless you have configured the server to support pages without file extensions!
You will need to configure the server to hide the extensions on the server via .htaccess.
DO NOT enable this option unless you have configured the server to support this functionality!
We cannot provide support on configuring the server or editing .htaccess. Use at your own risk!
Example of .htaccess file to enable support for pages without file extensions:
PHP EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
HTML EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
For my site building, I use html, I copied this second part of the code (which is meant for .html) and pasted in Notepad and saved it as .htaccess. Using FTP Software, i moved this file into my directory where I found all my .html files and images etc. I came back to open WYSIWYG Builder, opened my site, went to File>Options>Publish & Preview>Links (for advanced users only). Then enabled this button "Hide For Extension For Internal Links". I went and then published the whole site once again. It worked to my surprise. I was thrilled. Just thought of sharing this method, in case if some one is struggling to know what is .htaccess / where to place / how to use it / how to enable it through WYSIWYG.
Hats off Pablo....You are making people like us to grow. Thanks Sir.
Yet, I went into this File>Options>Publish & Preview>Links (for advanced users only). From here, I went to Help mode, as he directed. Without any negligence, I went to help mode and checked. There, I found this.
WARNING:
The generated files will still have extensions otherwise they will not be recognized as HTML/PHP files on the server!
So this means that internal links will no longer work unless you have configured the server to support pages without file extensions!
You will need to configure the server to hide the extensions on the server via .htaccess.
DO NOT enable this option unless you have configured the server to support this functionality!
We cannot provide support on configuring the server or editing .htaccess. Use at your own risk!
Example of .htaccess file to enable support for pages without file extensions:
PHP EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]
HTML EXTENTION REMOVAL
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.html [NC,L]
For my site building, I use html, I copied this second part of the code (which is meant for .html) and pasted in Notepad and saved it as .htaccess. Using FTP Software, i moved this file into my directory where I found all my .html files and images etc. I came back to open WYSIWYG Builder, opened my site, went to File>Options>Publish & Preview>Links (for advanced users only). Then enabled this button "Hide For Extension For Internal Links". I went and then published the whole site once again. It worked to my surprise. I was thrilled. Just thought of sharing this method, in case if some one is struggling to know what is .htaccess / where to place / how to use it / how to enable it through WYSIWYG.
Hats off Pablo....You are making people like us to grow. Thanks Sir.