Hello,
I am trying to find out if WD can publish websites with friendly URLs without file extensions like on Xara's website, ie: http://www.xara.com/us/
Thanks
Hello,
I am trying to find out if WD can publish websites with friendly URLs without file extensions like on Xara's website, ie: http://www.xara.com/us/
Thanks
Sure. If I read your question correctly you mean without the need to add index.htm to the URL?
If so then publish to your site as index.htm or index.html and the browser will automatically load the page.
Gary W. Priester
Mr. Moderator Emeritus Dude, Sir
gwpriester.com | eyetricks-3d-stereograms.com | eyeTricks on Facebook | eyeTricks on YouTube | eyeTricks on Instagram
I'm not sure if I said that correctly. My current site publishes a page like this: http://mydomain.com/products.htm
But I want it to publish it like this: http://mydomain.com/products
Yes you were right about my question. Sorry, at work trying to multi-task, and failing at it... lol
You need to be able to access and update your .htaccess file in your server root.
You need to include this:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.htm [NC,L]
To add a trailing slash:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^/]+)/$ $1.htm
RewriteRule ^([^/]+)/([^/]+)/$ /$1/$2.php
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !(\.[a-zA-Z0-9]{1,5}|/)$
RewriteRule (.*)$ /$1/ [R=301,L]
You can change htm to html.
Acorn
Acorn - installed Xara software: Cloud+/Pro+ and most others back through time (to CC's Artworks). Contact for technical remediation/consultancy for your web designs.
When we provide assistance, your responses are valuable as they benefit the community. TG Nuggets you might like. Report faults: Xara Cloud+/Pro+/Magix Legacy; Xara KB & Chat
Here is an example of the problem.
I have a WD file with 4 pages in it.
HOME (the index.htm) page
PRODUCTS
ABOUT
CONTACT
When I publish the WD file, it will produce 4 files and upload them into the root of the www server.
index.htm
products.htm
about.htm
contact.htm
When you go to the products page in a browser, it will call the URL with the file extension:
http://www.mysite/products.htm
However, instead I would like for it to read:
http://www.mysite/products
As far as I know, the only way that you can have it listed in the URL like that is to have each page in a separate sub-folder with an index.htm file. That would mean that instead of one WD file with multiple pages in it, you would have to have a separate WD file for each page. And structure the folders on the www server like this:
ROOT
index.htm
--PRODUCTS (folder)
index.htm
--ABOUT (folder)
index.htm
--CONTACT (folder)
index.htm
Please correct me if I'm wrong.
and I don't know much about .htaccess except to leave it alone.. lol
I'm looking into your htaccess file edit Acorn. Will that remove the .htm extension from the URL? if so, will I have to do anything different in my WD file? I read that you would have to make the link request without the extension. I don't know how WD would handle it, but I will continue to look into it and give it a try. Thanks.
derwalkerhaus - Just out of curiosity, why do you feel this is important or necessary?
And Acorn, what happens with your .htaccess file when a visitor bookmarks a page?
Gary W. Priester
Mr. Moderator Emeritus Dude, Sir
gwpriester.com | eyetricks-3d-stereograms.com | eyeTricks on Facebook | eyeTricks on YouTube | eyeTricks on Instagram
Bookmarks