| | |
changing the .php extension and Apache mod_rewrite question
Please support our PHP advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
•
•
Join Date: Apr 2007
Posts: 13
Reputation:
Solved Threads: 0
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

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
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:
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) 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:
PHP Syntax (Toggle Plain Text)
AddType application/x-httpd-php .php .xxx
PHP Syntax (Toggle Plain Text)
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!
Brainyminds | Merchant Account Services | I Love Code
IT'S HERE: Merchant Accounts 101 Everything you need to know about merchant accounts!
![]() |
Similar Threads
- Apache (Linux Servers and Apache)
- Help in PHP extension (PHP)
- Newbie Question - Hiding php extension (PHP)
- Apache mod_rewrite with Google Ads (Linux Servers and Apache)
- Set up manually, php 5.0 with apache's compatible version (PHP)
Other Threads in the PHP Forum
- Previous Thread: Hide source of the page
- Next Thread: I m a beginner in PHP-Mysql
| Thread Tools | Search this Thread |
.htaccess ajax apache api array beginner binary body broken cakephp checkbox class cms code cron curl database date date/time directory display dynamic echo email error file files folder form forms function functions global google href htaccess html image include insert integration ip java javascript joomla limit link list login loop mail memmory menu mlm mod_rewrite msqli_multi_query multiple mycodeisbad mysql oop parameter paypal pdf php problem query radio random recourse recursion regex registrationform remote script search seo server sessions sms soap source space sql static syntax system table tutorial update upload url validation validator variable video web webdesign wordpress xml youtube






