Forum Moderators: coopster

Message Too Old, No Replies

PHP hide with others not hidden

php security and hidding the .php

         

HeadBut

5:46 pm on Jul 8, 2005 (gmt 0)

10+ Year Member



I have a domain on apache I'd like to hide the '.php'nes. Can I do it and leave the other domains with the visible option.. and is there a good doc/tutorial on hidding '.php'

Thanks

coopster

8:41 pm on Jul 8, 2005 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



Sure you can. Setup up a virtual host for the subdomain and go from there. You can play around in the subdomain all day long without interfering with your other sites.

If I understand you correctly you seem to be referring to "extensionless URIs". A quick search for that phrase or "Cool URI" will turn up some reading. It goes hand-in-hand with Content Negotiation [httpd.apache.org].

mogenshoj

8:46 pm on Jul 8, 2005 (gmt 0)

10+ Year Member



Using modrewrite?
Is needs to be enables on the server though.

You can put this in a .htaccess file and put it on the root of your domain:

RewriteEngine on
Rewritebase /
RewriteRule ^([a-zA-Z0-9_-]*).html $1.php

-------
Then if you goto www.mydomain.com/my_file.html the server will really call my_file.php, but noone can see that.

Use it in a subdirectory for testing though. If the script above doesnt work (did it by memory) or if you server doesn't support modrewrite, it will make a 500 server error.

Is that what you mean?

HeadBut

3:39 pm on Jul 11, 2005 (gmt 0)

10+ Year Member



perfect, I think thats plenty of info to get me going in the right direction!

Many Thanks

HeadBut

3:42 pm on Jul 11, 2005 (gmt 0)

10+ Year Member



Wow, A search on Google for "extensionless URIs Cool URI" found this as the fourth item:

PHP hide with others not hidden
If I understand you correctly you seem to be referring to "extensionless URIs".
A quick search for that phrase or "Cool URI" will turn up some reading. ...
www.webmasterworld.com/forum88/9081.htm - Similar pages

Google got this thing indexed quickly!