944,171 Members | Top Members by Rank

Ad:
  • PHP Discussion Thread
  • Unsolved
  • Views: 6515
  • PHP RSS
Jul 21st, 2007
0

changing the .php extension and Apache mod_rewrite question

Expand Post »
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
Similar Threads
FBI
Reputation Points: 10
Solved Threads: 0
Newbie Poster
FBI is offline Offline
13 posts
since Apr 2007
Jul 21st, 2007
0

Re: changing the .php extension and Apache mod_rewrite question

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.
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Jul 21st, 2007
0

Re: changing the .php extension and Apache mod_rewrite question

Take a look at this, perhaps it will help:
http://www.evolt.org/article/Search_...ache/17/15049/
Moderator
Featured Poster
Reputation Points: 3239
Solved Threads: 839
Posting Genius
Ezzaral is offline Offline
6,761 posts
since May 2007
Jul 21st, 2007
0

Re: changing the .php extension and Apache mod_rewrite question

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:
PHP Syntax (Toggle Plain Text)
  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:
PHP Syntax (Toggle Plain Text)
  1. RedirectMatch 301 ^/(.*)\.php$ http://www.yourdomain.com/$1.xxx
Moderator
Reputation Points: 161
Solved Threads: 38
He's No Good To Me Dead
stymiee is offline Offline
1,422 posts
since May 2006
Jul 22nd, 2007
0

Re: changing the .php extension and Apache mod_rewrite question

tnx a lot.
FBI
Reputation Points: 10
Solved Threads: 0
Newbie Poster
FBI is offline Offline
13 posts
since Apr 2007

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in PHP Forum Timeline: Hide source of the page
Next Thread in PHP Forum Timeline: I m a beginner in PHP-Mysql





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC