The ProgrammersTalk Community
Forum Register Search Today's Posts Mark Forums Read
Register

Go Back   The ProgrammersTalk Community > Web Programming > PHP


Welcome to the The ProgrammersTalk Community forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.
Tags:

Closed Thread
 
LinkBack Thread Tools    Display Modes   
  #1 (permalink)  
Old 09-09-2007, 01:09 PM
Xhris
Posts: n/a
[SOLVED] How to remove the .php extention on a URL?

So can anyone point me in the direction to do this? If I have a webage that is lets say www.page.com/link.php and I want to be able to get to this page by typing www.page.com/link.

So what would be the easiest way to do this? Would it be .htaccess?

Thanks for any help on this.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #2 (permalink)  
Old 09-09-2007, 01:19 PM
Lee's Avatar
Lee Lee is offline
PT Staff*
Awards Showcase
Quality Tutorial 
Total Awards: 1
Join Date: Jun 2007
Location: Blackpool, UK
Posts: 615
iTrader: (0)
Lee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enoughLee will become famous soon enough
This link:
OSResources - How can I remove the .php extension of my files with Apache and lighttpd?

Explains how to do what you want by editing the .htaccess file (if you have one) if not then tell us all and give us more information.
The Following User Says Thank You to Lee For This Useful Post:
HelloWorld (09-10-2007)
  #3 (permalink)  
Old 09-09-2007, 01:23 PM
Xhris
Posts: n/a
thanks,

I do have a .htaccess file. I have tried the above site already. I have the .htaccess 301 redirect in my .htaccess file now and below that I added the following code
RewriteRule ^([^\.\?]+)(\?.*)?$ $1.php

No luck with it. I have the .htaccess file in my public_html dir also.

__________________

Digg this Post! Del.Icio.Us this Post! Technorati this Post! Furl this Post! Mister Wong this Post! Newsvine this Post! Spurl this Post! Reddit this Post! Netscape this Post!
  #4 (permalink)  
Old 09-10-2007, 09:00 AM
ccoonen ccoonen is offline
PT Staff
Awards Showcase
Quality Tutorial Quality Tutorial Quality Tutorial Quality Tutorial 
Total Awards: 4
Join Date: Jun 2007
Location: Wisconsin
Posts: 308
iTrader: (0)
ccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished roadccoonen is on a distinguished road
Their are directory or folder defaults for a web-server. In IIS you can set any file + extension of a file you want as a default - like index.asp, index.htm, index.html, default.php whatever... Then you just have to have a matching file in that folder... so if you hit blah.com/ and you had a file named index.htm inside that folder, it would display the contents of index.htm

Whats really cool is that you never actually have to "Reveal" the filenames - so you could do hello.com/?userid=45&content=edit and they would never know if its asp or php or cfm or what...
Closed Thread


Thread Tools
Display Modes

   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
Trackbacks are On
Pingbacks are On
Refbacks are On



All times are GMT -7. The time now is 11:15 PM. Powered by vBulletin
Copyright © 2000 - 2007, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO © 2007 ProgrammersTalk Sedo - Buy and Sell Domain Names and Websites project info: programmerstalk.net Statistics for project programmerstalk.net etracker® web controlling instead of log file analysis


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50