changing the .php extension and Apache mod_rewrite question

Reply

Join Date: Apr 2007
Posts: 13
Reputation: FBI is an unknown quantity at this point 
Solved Threads: 0
FBI FBI is offline Offline
Newbie Poster

changing the .php extension and Apache mod_rewrite question

 
0
  #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 11:37 pm. Reason: removed unecessary bbcode
Reply With Quote Quick reply to this message  
Join Date: May 2007
Posts: 4,490
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 517
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: changing the .php extension and Apache mod_rewrite question

 
0
  #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 Quick reply to this message  
Join Date: May 2007
Posts: 4,490
Reputation: Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of Ezzaral has much to be proud of 
Solved Threads: 517
Moderator
Featured Poster
Ezzaral's Avatar
Ezzaral Ezzaral is offline Offline
Industrious Poster

Re: changing the .php extension and Apache mod_rewrite question

 
0
  #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 Quick reply to this message  
Join Date: May 2006
Posts: 1,422
Reputation: stymiee is on a distinguished road 
Solved Threads: 35
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

 
0
  #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:
  1. 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:
  1. 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 Quick reply to this message  
Join Date: Apr 2007
Posts: 13
Reputation: FBI is an unknown quantity at this point 
Solved Threads: 0
FBI FBI is offline Offline
Newbie Poster

Re: changing the .php extension and Apache mod_rewrite question

 
0
  #5
Jul 22nd, 2007
tnx a lot.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Similar Threads
Other Threads in the PHP Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC