Forum Moderators: phranque

Message Too Old, No Replies

Trying to remove file extensions on website

how to mod rewrite, remove file extensions on website

         

ATLSoftwareEngineer

5:59 am on Dec 21, 2007 (gmt 0)

10+ Year Member



Hey Guys,

I read many amazing options on the mod rewrite but here's what I'm trying to accomplish.

I simply want to be able to make my website "SEO" friendly by not having the file extension show.

Here's my question. I will probably have some .htm and .html files in there, but I will be making it primarly .aspx files

So...

can I have my site show no file extension but allow all the file extensions? .htm, .html, .aspx..maybe .php too?

If so, How can I? , (other than creating a folder for every individual page, which I would prefer not to do....)

jdMorgan

6:13 am on Dec 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, you can do that, but the fewer the number of filetypes, the more efficient the code -- The code will have to do an 'exists' check on each filetype, and those are expensive in terms of CPU and (possibly) disk I/O.

Try a search for "extensionless URLs" here on WebmasterWorld to turn up previous threads.

Jim

ATLSoftwareEngineer

6:18 am on Dec 21, 2007 (gmt 0)

10+ Year Member



That was quick Jim. Thanks. Ok so lets say I just make everything .aspx.... I did see all kinds of options but didnt quite find an extensionless check to swap out one file for the other.

Maybe I didnt look hard enough, but if anyone knows a simple rewrite to swap .html files to .aspx I'd certainly appreciate it!

Also, do I need 2 rewrites if I want .htm to be .aspx but not show the file extension

as well as

.html to go to .aspx without showing the file extension?

Thanks in advance.

jdMorgan

2:18 pm on Dec 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



> Maybe I didn't look hard enough

I found a good example within the top three threads listed on WebmasterWorld using the suggested search words [google.com]... Please dig deeper.

This is a do-it-yourself forum, as described in our forum charter [webmasterworld.com]. You will likely need to research [httpd.apache.org] and understand the examples you find, and then modify them to fit your exact needs. Specific questions are welcome.

Jim

pageoneresults

2:33 pm on Dec 21, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Welcome to WebmasterWorld ATLSoftwareEngineer.

Are you on Apache or Windows? You say .aspx, that's a Windows extension.

I believe what you are referring to is called...

HTTP/1.1: Content Negotiation
[w3.org...]