Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me
Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old June 28th, 2009, 07:58 PM
Skipt's Avatar
Skipt Skipt is offline
CSS Guru in Training
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2009
Location: Maryland, USA
Posts: 2,044 Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 84 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 1 h 59 m 48 sec
Reputation Power: 1225
Send a message via AIM to Skipt
Facebook
Removing file extension

I tried Googling this but none of them fit my liking. Basically in the root directory of my site, (public_html) I have all my files. I have index.html, contact.html, about.html, portfolio.html and articles.html. I would like help on removing the file extension. One that will allow me to go to (for example)

www.devwebsites.com/about.html

and remove the .html and display the code from about.html. And alternately if I type in www.devwebsites.com/about it should return the code from about.html, but not show about.html in the URL bar. I need this to work with other files such as contact.html, etc..

I hope I explained my problem good enough..

Thanks.
__________________
"Quality of responses may vary. I reserve the right to change my mind for any reason what-so-ever without admitting I was wrong. I'd prefer to change your mind however, it's easier on my ego". - jwdonahue

Reply With Quote
  #2  
Old June 28th, 2009, 08:46 PM
Skipt's Avatar
Skipt Skipt is offline
CSS Guru in Training
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2009
Location: Maryland, USA
Posts: 2,044 Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 84 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 1 h 59 m 48 sec
Reputation Power: 1225
Send a message via AIM to Skipt
Facebook
Just in case you wanted to see my attempt. Here is my entire .htaccess file{

Code:
ErrorDocument 404 /404.html


RewriteEngine On

RewriteCond %{HTTP_HOST} ^devwebsites.com [NC]
RewriteRule ^(.*)$ http://www.devwebsites.com/$1 [L,R=301]

RewriteCond %{REQUEST_URI}!(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME}!-d
RewriteCond %{REQUEST_fileNAME}!-f
RewriteRule (.*) /$1.html [L]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,9}\ /([^.]+\.)+html\ HTTP
RewriteRule ^(.+)\.html$ http://www.devwebsites.com/$1 [R=301,L]
But this gives me a 500 error..

Reply With Quote
  #3  
Old June 28th, 2009, 08:46 PM
requinix's Avatar
requinix requinix is offline
nuts - top 5 poster again :(
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 5,301 requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)  Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 9 h 54 m 20 sec
Reputation Power: 2967
Send a message via MSN to requinix
MultiViews.
Code:
Options +MultiViews
Comments on this post
Skipt agrees: Could you expand on that
__________________
How to ask a PHP question | My stuff

Last edited by requinix : June 28th, 2009 at 08:56 PM. Reason: added a link

Reply With Quote
  #4  
Old June 28th, 2009, 08:53 PM
Skipt's Avatar
Skipt Skipt is offline
CSS Guru in Training
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2009
Location: Maryland, USA
Posts: 2,044 Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 84 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 1 h 59 m 48 sec
Reputation Power: 1225
Send a message via AIM to Skipt
Facebook
Hi,

I am not sure what that is supposed to mean. Could you expand on that? I found a guywith the same question on me here: http://www.webmasterworld.com/apache/3371997.htm. Problem is their code didn't work for me. 500 error

Reply With Quote
  #5  
Old June 28th, 2009, 09:02 PM
requinix's Avatar
requinix requinix is offline
nuts - top 5 poster again :(
Click here for more information.
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 5,301 requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)requinix User rank is General 30th Grade (Above 100000 Reputation Level)  Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1Folding Points: 161153 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 4 Months 9 h 54 m 20 sec
Reputation Power: 2967
Send a message via MSN to requinix
(I edited a link into my post)

It does exactly what you want: you can link to /about and Apache will automatically serve up about.html.

If you add that Option to your .htaccess then you can use links without the extension - so long as the extension has been registered somewhere - like with AddType. If it gets a request for /foo, Apache will look (if the file/directory doesn't exist) for /foo.* where the * is any extension it knows about: html, php, jpg...

By the way,
Code:
RewriteCond %{REQUEST_URI} !(\.[^./]+)$
RewriteCond %{REQUEST_fileNAME} !-d
RewriteCond %{REQUEST_fileNAME} !-f

It's missing the spaces.

Reply With Quote
  #6  
Old June 28th, 2009, 09:05 PM
Skipt's Avatar
Skipt Skipt is offline
CSS Guru in Training
Dev Shed Regular (2000 - 2499 posts)
 
Join Date: Jan 2009
Location: Maryland, USA
Posts: 2,044 Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)Skipt User rank is General 4th Grade (Above 100000 Reputation Level)  Folding Points: 84 Folding Title: Novice Folder
Time spent in forums: 3 Weeks 1 Day 1 h 59 m 48 sec
Reputation Power: 1225
Send a message via AIM to Skipt
Facebook
Yea, it does look like it will do what I want. However, I just fixed the space issue, and now it works like I want. Redirects if I add .html on the end, and works perfectly. Thanks requinix!

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > Removing file extension


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump




 Free IT White Papers!
 
How to Present Effectively Online
This white paper offers practical and actionable advice on the key steps that any presenter should consider as they plan and execute a Webinar or online meeting.

 
Open Source Security Myths
Open Source Software (OSS) is computer software whose source code is available to the general public with relaxed or non-existent intellectual property restrictions (or arrangement such as the public domain), and is usually developed with the input of many contributors.

 
Power and Cooling Capacity Management for Data Centers
This paper describes the principles for achieving power and cooling capacity management.

 
Scalable, Fault-Tolerant NAS for Oracle - The Next Generation
For several years NAS has been evolving as a storage alternative for Oracle databases, and for good reason: NAS is quite often the simplest, most cost-effective storage approach for Oracle. Learn about the benefits that HP's approach to scalable NAS brings to Oracle environments in this comprehensive white paper.

 
Understanding Web Application Security Challenges
This white paper discusses many common threats and preventive measures for Web application security, and explains what you can do to help protect your organization.

 

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 




© 2003-2009 by Developer Shed. All rights reserved. DS Cluster 4 Hosted by Hostway
Stay green...Green IT