December 14, 200817 yr Hello All, I figured that I want to prevent my site address from displaying the page extensions and instead of www.example.com/info.html i'd like to have it displayed as www.example.com/info/. Can you please help me do this? I've gone as far as creating folders individually and storing each one of my pages in the folders and naming them all index.html. However, when I get around to linking them through the folder it still displays the whole extension. Where am I going wrong?
December 14, 200817 yr Hello All, I figured that I want to prevent my site address from displaying the page extensions and instead of www.example.com/info.html i'd like to have it displayed as www.example.com/info/. Can you please help me do this? I've gone as far as creating folders individually and storing each one of my pages in the folders and naming them all index.html. However, when I get around to linking them through the folder it still displays the whole extension. Where am I going wrong? hello first creat a folder call it test inside that folder create a file called index.html with a bits of text in put it to the server then goto www.youURL.com/test just name 1 file index.html just tried it it worked for me try that good luck
December 14, 200817 yr Author hello first creat a folder call it test inside that folder create a file called index.html with a bits of text in put it to the server then goto www.youURL.com/test just name 1 file index.html just tried it it worked for me try that good luck Hi ELITE, many thanks for replying, I will try it in the morning as it just struck 2.30am! I better log out before i start whoring the forum lol! I'll let you know how I get on. Thank you
December 14, 200817 yr If you're using Apache, a sensible alternative would be mod_rewrite. You could then cause www.example.com/info to be the same as www.example.com/info.html without creating new folders. For example, in a .htaccess file in the correct directory: RewriteEngine On RewriteRule ^/info$ /info.html [L] and keep writing new RewriteRule lines for each page. mod_rewrite can be a lot more sophisticated too, if you want it to be; e.g. it can send people to different pages depending on the headers like user agent (browser) or IP address in the request, and even the time of day!
December 14, 200817 yr Author If you're using Apache, a sensible alternative would be mod_rewrite. You could then cause www.example.com/info to be the same as www.example.com/info.html without creating new folders. For example, in a .htaccess file in the correct directory: RewriteEngine On RewriteRule ^/info$ /info.html [L] and keep writing new RewriteRule lines for each page. mod_rewrite can be a lot more sophisticated too, if you want it to be; e.g. it can send people to different pages depending on the headers like user agent (browser) or IP address in the request, and even the time of day! Hi Connetu_C, Thanks for replying, i don't have Apache and I haven't heard of it before, could you please send me a link or something where I can learn more about Apache please. I'd be most thankful. Ren
December 14, 200817 yr Yep, see Apache HTTP Server. It's probably the most common static and PHP Web server used on Linux servers today (possibly also on Windows Server as an alternative to IIS). Also see mod_rewrite. Out of interest, what Web server are you using if not Apache?
December 14, 200817 yr Author Yep, see Apache HTTP Server. It's probably the most common static and PHP Web server used on Linux servers today (possibly also on Windows Server as an alternative to IIS). Also see mod_rewrite. Out of interest, what Web server are you using if not Apache? Thanks for this Connetu_C, I'm using a Linux server, to be honest, I don't really know much about servers. I may have to dedicate some google reading time on reading about the many servers and what makes each of them different. Thanks again for the links, Ren
December 14, 200817 yr Linux is an operating system. Apache is one example of a Web server, an application which runs in the operating system on the server hardware. The terminology can be a bit confusing at first because "server" can be used to refer to either hardware or software, or both. E.g. "Web server" can mean hardware running web services (like page serving, mail, databases etc.), or a piece of software (like Apache) which does HTTP(S) request serving. Since the OS is Linux, there's a high probability the Web server is Apache. If you don't know, one way would be to create a .htaccess file in a directory and see if has any effect. The example mod_rewrite code I gave earlier would do the trick. Also make sure the .htaccess file has Linux filesystem permissions so it can be read by the Web server. Google for ".htaccess" for more information.
December 15, 200817 yr hello first creat a folder call it test inside that folder create a file called index.html with a bits of text in put it to the server then goto www.youURL.com/test just name 1 file index.html just tried it it worked for me try that good luck Not a good way of doing it in my opinion. If you're using Apache, a sensible alternative would be mod_rewrite. You could then cause www.example.com/info to be the same as www.example.com/info.html without creating new folders. For example, in a .htaccess file in the correct directory: RewriteEngine On RewriteRule ^/info$ /info.html [L] and keep writing new RewriteRule lines for each page. mod_rewrite can be a lot more sophisticated too, if you want it to be; e.g. it can send people to different pages depending on the headers like user agent (browser) or IP address in the request, and even the time of day! Perfect way of doing it in my opinion.
Create an account or sign in to comment