User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the PHP section within the Web Development category of DaniWeb, a massive community of 423,017 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,992 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our PHP advertiser: Lunarpages PHP Web Hosting
Views: 1773 | Replies: 4
Reply
Join Date: Apr 2007
Posts: 13
Reputation: FBI is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
FBI FBI is offline Offline
Newbie Poster

changing the .php extension and Apache mod_rewrite question

  #1  
Jul 21st, 2007
hello my friends
I'm new to web dev so ive started learning PHP.
i have a couple of questions...

1. Can i change the default .php extension to .whatever ?
2. Can i change something.html to something.whaever extension? in Apache Mod rewrite? i mean SEO. i want to make fake extension that can show like this:

index.jsp
whatever.jsp etc...
i know im using PHP but would it be possible change to .jsp extension? ive installed XAMPP on my local PC and I edited Apache.conf file and added index.jsp next to the AppDirectory. so shouldn't it allow .jsp extension?

if so please explain it in detail as much as you can.
anyhelp would be much
appreciated
Last edited by stymiee : Jul 21st, 2007 at 10:37 pm. Reason: removed unecessary bbcode
AddThis Social Bookmark Button
Reply With Quote  
Join Date: May 2007
Location: USA
Posts: 2,814
Reputation: Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all 
Rep Power: 12
Solved Threads: 281
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Maven

Re: changing the .php extension and Apache mod_rewrite question

  #2  
Jul 21st, 2007
I believe Apache will let you map any extension you wish to a given mime type, but off the top of my head I can't recall which file it is in. Check the docs on mapping mime types.
Reply With Quote  
Join Date: May 2007
Location: USA
Posts: 2,814
Reputation: Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all Ezzaral is a name known to all 
Rep Power: 12
Solved Threads: 281
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Posting Maven

Re: changing the .php extension and Apache mod_rewrite question

  #3  
Jul 21st, 2007
Take a look at this, perhaps it will help:
http://www.evolt.org/article/Search_...ache/17/15049/
Reply With Quote  
Join Date: May 2006
Location: New Jersey
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Rep Power: 5
Solved Threads: 34
Moderator
stymiee's Avatar
stymiee stymiee is offline Offline
He's No Good To Me Dead

Re: changing the .php extension and Apache mod_rewrite question

  #4  
Jul 21st, 2007
There are two ways to do this:

1) Tell Apache to parse all .phpfiles a .xxxfile. Using this method you do not have to change any files extensions or worry about any redirects. To do this, place this code in your httpd.conf file:
AddType application/x-httpd-php .php .xxx
2) Use a 301 redirect to redirect from the .php files to the .xxx files. You can do that by placing this code in the root directory of your website:
RedirectMatch 301 ^/(.*)\.php$ http://www.yourdomain.com/$1.xxx
John Conde
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
Reply With Quote  
Join Date: Apr 2007
Posts: 13
Reputation: FBI is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
FBI FBI is offline Offline
Newbie Poster

Re: changing the .php extension and Apache mod_rewrite question

  #5  
Jul 22nd, 2007
tnx a lot.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb PHP Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the PHP Forum

All times are GMT -4. The time now is 4:11 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC