Welcome, Guest: Register On Nairaland / LOGIN! / Trending / Recent / NewStats: 3,195,125 members, 7,957,223 topics. Date: Tuesday, 24 September 2024 at 09:24 AM |
Nairaland Forum / Science/Technology / Webmasters / How Do I Remove Extension From Urls. (842 Views)
Introducing The Joomla Auto Update Extension From Joomlashowroom / How To Remove Index.php From Urls In Joomla / How Webmasters Can Make Money By Shortening Urls (2) (3) (4)
How Do I Remove Extension From Urls. by feelme3(m): 11:49pm On Jul 21, 2011 |
Hello, I want to remove the file extensions on my webpages , for example www.mydomain.com/index.html to show www.mydomain.com Can someone please tell me how i can hide the extension of the page(s)? I've read and applied the .htaccess to my root folder public_html but still no effect so i need you guys help. THanks Here's the code on my .htaccess file Options +FollowSymlinks RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^.]+)/?$ $1.html?%{QUERY_STRING} [L] |
Re: How Do I Remove Extension From Urls. by Nobody: 12:03am On Jul 22, 2011 |
And you are sure that ehm your server supports .htaccess? and the rewrite engine is on? Abi petrol don finish for the rewrite engine ni? |
Re: How Do I Remove Extension From Urls. by Mobinga: 12:30am On Jul 22, 2011 |
When you navigate to yourdomain.com does it show index.html? Here's an alternative Create directories. For instance, you want www.yourdomain.com/contacts, create a contacts directory in your web root and add rename your original contacts.html to index.html, put it there. public_html ---contacts ------index.html ---about ------index.html That is all! |
Re: How Do I Remove Extension From Urls. by feelme3(m): 12:49am On Jul 22, 2011 |
*dhtml:How I go check weda the server dey support .htaccess? Na wa oh, U dey always forget say I be registered student for ur class oh. @Mobinga, so am going to have to create that for all the pages? I have almost 20pages. Isn't there a better way or simpler way than this? |
Re: How Do I Remove Extension From Urls. by Mobinga: 12:52am On Jul 22, 2011 |
rewriterule ^(([^/]+/)*[^./]+)$ /$1.html [L] I'm not good in using .htaccess http://www.webmasterworld.com/apache/3715021.htm |
Re: How Do I Remove Extension From Urls. by Nobody: 9:42pm On Jul 22, 2011 |
Santa Maria! I laff in spanish, well, you guys got it all wrong - i have been too busy tweaking my framework to reply properly. Lets do a very short tutorial on redirecting. Rewrite does not actually change the browser path physically. It just decide on what webpage to load and send the requests to. For instance my framework which has various links - gets to rewrite everything to Relative: redirecting any .php to / of the website. Options +FollowSymlinks Let us assume you have this .htaccess on say: http://www.dhtmlkits.com/framework The browser will immediately redirect to http://www.dhtmlkits.com/ / of course means the root. If you are anywhere on your localhost, / will be http://localhost/ Absolute: specify full url to redirect to Options +FollowSymlinks I dont have time to continue. . .let me stop here - hopefully you should be able to carryon from here. |
(1) (Reply)
Can We Hook Up? / 4 Ways You Can Instantly Get Free 1000 SMS Units To Send Message To All Networks / Please Help Me O! How Can I Create An Advert Banner For My Blog By Myself?
(Go Up)
Sections: politics (1) business autos (1) jobs (1) career education (1) romance computers phones travel sports fashion health religion celebs tv-movies music-radio literature webmasters programming techmarket Links: (1) (2) (3) (4) (5) (6) (7) (8) (9) (10) Nairaland - Copyright © 2005 - 2024 Oluwaseun Osewa. All rights reserved. See How To Advertise. 15 |