473,836 Members | 1,358 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

hidden php file extension

hi,there

how can i make php file extension hidden in the URL somthing like this
(http://mail.google.com/mail/?view)

Regard....

Mar 21 '06 #1
19 3842
Ba***********@g mail.com writes:
hi,there

how can i make php file extension hidden in the URL somthing like this
(http://mail.google.com/mail/?view)


If you do this the parameter ?view is appended the index.php file in
that dir, so it's quite easy, just make sure your index.php
understands ?view. Another way is to make .html (.htm) files to be
parsed as php, then you have index.html but you can actually use
php in the file.

--
Henrik Hansen
Mar 21 '06 #2
Henrik suggestions are correct. Another way to mask file extensions is
by using mod_rewrite in apache

Mar 21 '06 #3
Henrik Hansen wrote:
Ba***********@g mail.com writes:
hi,there

how can i make php file extension hidden in the URL somthing like this
(http://mail.google.com/mail/?view)


If you do this the parameter ?view is appended the index.php file in
that dir, so it's quite easy, just make sure your index.php
understands ?view. Another way is to make .html (.htm) files to be
parsed as php, then you have index.html but you can actually use
php in the file.

That is not really a good idea as it puts a hugh load on the server. Now
for EVERY .html page apache servers it will have to parse each .html
page for php script, even if the page has no php script in it. This
really increases the load on the server. It all translates to SLOWER
pages. Is that what you really want to achieve?
Mar 22 '06 #4
youcantoo <dw*@findmoore. net> writes:
Henrik Hansen wrote:
Ba***********@g mail.com writes:
hi,there

how can i make php file extension hidden in the URL somthing like this
(http://mail.google.com/mail/?view)

If you do this the parameter ?view is appended the index.php file in
that dir, so it's quite easy, just make sure your index.php
understands ?view. Another way is to make .html (.htm) files to be
parsed as php, then you have index.html but you can actually use php
in the file.

That is not really a good idea as it puts a hugh load on the
server. Now for EVERY .html page apache servers it will have to parse
each .html page for php script, even if the page has no php script in
it. This really increases the load on the server. It all translates to
SLOWER pages. Is that what you really want to achieve?


Do you have any banchmarks for your claims? I use this way and can't
really see any difference at all to be honest. Parsing pages to see if
there is php in it goes VERY fast. Ofcource everything is relative but
in general I think it's a good way of masking files.

You could also just turn it on on the php folders if you have seperate
static content folders, so they dont get treatet as php.

--
Henrik Hansen
Mar 22 '06 #5
Henrik Hansen wrote:
youcantoo <dw*@findmoore. net> writes:

Henrik Hansen wrote:
Ba********** *@gmail.com writes:
hi,there

how can i make php file extension hidden in the URL somthing like this
(http://mail.google.com/mail/?view)

If you do this the parameter ?view is appended the index.php file in
that dir, so it's quite easy, just make sure your index.php
understand s ?view. Another way is to make .html (.htm) files to be
parsed as php, then you have index.html but you can actually use php
in the file.


That is not really a good idea as it puts a hugh load on the
server. Now for EVERY .html page apache servers it will have to parse
each .html page for php script, even if the page has no php script in
it. This really increases the load on the server. It all translates to
SLOWER pages. Is that what you really want to achieve?

Do you have any banchmarks for your claims? I use this way and can't
really see any difference at all to be honest. Parsing pages to see if
there is php in it goes VERY fast. Ofcource everything is relative but
in general I think it's a good way of masking files.

You could also just turn it on on the php folders if you have seperate
static content folders, so they dont get treatet as php.


You obviously don't have a very heavily loaded server. You get one with
a few thousand hits/minute and it's a definite hit. How much depends on
the size of the HTML files, the percentage of PHP in the files and a
bunch of other things.

Why do you even care about masking the files, anyway?

--
=============== ===
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
js*******@attgl obal.net
=============== ===
Mar 22 '06 #6
Jerry Stuckle <js*******@attg lobal.net> writes:
Henrik Hansen wrote:
youcantoo <dw*@findmoore. net> writes:
Henrik Hansen wrote:

Ba********* **@gmail.com writes:
>hi,there
>
>how can i make php file extension hidden in the URL somthing like this
>(http://mail.google.com/mail/?view)

If you do this the parameter ?view is appended the index.php file in
that dir, so it's quite easy, just make sure your index.php
understan ds ?view. Another way is to make .html (.htm) files to be
parsed as php, then you have index.html but you can actually use php
in the file.
That is not really a good idea as it puts a hugh load on the
server. Now for EVERY .html page apache servers it will have to parse
each .html page for php script, even if the page has no php script in
it. This really increases the load on the server. It all translates to
SLOWER pages. Is that what you really want to achieve?

Do you have any banchmarks for your claims? I use this way and can't
really see any difference at all to be honest. Parsing pages to see if
there is php in it goes VERY fast. Ofcource everything is relative but
in general I think it's a good way of masking files.
You could also just turn it on on the php folders if you have
seperate
static content folders, so they dont get treatet as php.


You obviously don't have a very heavily loaded server. You get one
with a few thousand hits/minute and it's a definite hit. How much
depends on the size of the HTML files, the percentage of PHP in the
files and a bunch of other things.

Why do you even care about masking the files, anyway?


The goal was to make the best looking urls which meant a .php
extension was out of the picture. But as I said everything is
relative.. our .htm files are purely php. If you mix php and html very
much maybe the performance cost is bigger. I have no numbers of how
much traffic it gets per second but I don't think it's a few
thousand.. although we did test with ab.

--
Henrik Hansen
Mar 22 '06 #7
Ba***********@g mail.com wrote:
hi,there

how can i make php file extension hidden in the URL somthing like this
(http://mail.google.com/mail/?view)

Regard....


Here's what I've done in the past:

(index.php)
switch($_GET['id'])
{
case 'main':
require 'main.php';
break;
case 'about':
require 'about.php';
break;
default:
require 'main.php';
break;
}

then you could type http://yourdomain?id=main

if you really wanted to drop the ID part, you'd have to use multiple
ifs, not a switch.

Just never, ever use unsanitized input from $_GET/$_POST.

ie. this is *bad*:

require '$_GET['id']'.'.php';

bad, bad, bad. Don't. ;)

As for a performance hit, I've never noticed one, but I don't run
large-scale websites, so take my experience with a grain of salt.

Sorry if my PHP isn't up to par, I'm thinking in Ruby lately.
Mar 22 '06 #8
Jerry Stuckle:
Why do you even care about masking the files, anyway?


Because filename extensions in URLs are generally worse than useless,
and at least in Apache you need to *do* something (i.e., reconfigure
it) before it will accept "extension-less" URLs.

--
Jock

Mar 22 '06 #9
hi, again

thanks for all u pepole

Henrik Hansen
i think this is good solution (making folders for each system) for
module projects.

tihu
thanks for your suggestion but you have to configure the Apache server
so you have to get permission on your hosting to make changes.

youcantoo
i thught that Henrik Hansen idea is to make folder and index.html file
for each forlder we can make also index.php if we need so i think there
will be no huge load on the server, in the other side if there is load
it will be scaled in micro second.

Jerry Stuckle
i think we need masking for confusing pepole whom wanna to try playing
with some web site URL or find other site resources.

burke
i will try your idea.

Apr 3 '06 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
11835
by: Paul | last post by:
I am trying to get a form to dynamicaly add hidden elements. Below is the function I've created, basicaly it loops thru an array and attempts to add those values to a newly created hidden input field which it then appends to the form. I works in IE, but in NN7 nothing is passed. function processAssortment(){ // get the form Element var formElement=document.getElementById("candyBoxForm"); //loop thru the candy box contents, add them to...
3
1603
by: markus | last post by:
I have an application that I think was developed using some form of Borland C with a folder for BIG images with the extension .fre. When I try to view them they cannot be read even by changing the extension to jpg, bmp, zip, etc. I also used some utilities for resource extraction with no success. I know the images are there and there has to be a way to show and convert them to a known format. I have seen libjpeg.dll and zlib.dll in...
3
1936
by: Botan Guner | last post by:
Hi everyone, I'm running php on win2000 server and iis. I have a script that builds the directory sturcture of a directory or a drive. My problem is that i want to find that which directories are hidden. I have looked stat() function but it seems that it does not return a value for being hidden or not. Thanks for any help,
7
1474
by: Shaul Feldman | last post by:
Hello, the question is how can I masquerade ASPX files behind HTML extension? Thank you in advance. -- With the best wishes, Shaul Feldman
2
2018
by: UJ | last post by:
I have an aspx page that does some database look ups on the initial load. I then need to do stuff later after an autopostback based on some of the values. So I put some variables in input variables of type hidden. Problem is on the reload-prerender the variables are not filled in yet. Is the best solution session variables? TIA.
3
3173
by: Shapper | last post by:
Hello, I created a script to upload a file. To determine the file type I am using userPostedFile.ContentType. For example, for a png image I get "image/png". My questions are: 1. Where can I find a list of all the types which can be returned? For example, if it is a Word document will it return "document/doc".
0
2635
by: rautsmita | last post by:
hello friends , i am using to jdk6 and JAXB2.0, i have geomtry.xsd file i am trying to compile this file using jaxb but i got some error i.e.The particle of the type is not a valid restriction of the particle of the base this xsd file is valid as per w3c standard i am also providing error in detail and geometry.xsd file geometry.xsd <?xml version="1.0" encoding="UTF-8"?> <schema targetNamespace="http://www.opengis.net/gml"...
11
6042
by: geoffbache | last post by:
Hi, As part of my efforts to write a test tool that copes with GUIs nicely, I'm trying to establish how I can start a GUI process on Windows that will not bring up the window. So I try to hide the window as follows: info = subprocess.STARTUPINFO() info.dwFlags |= subprocess.STARTF_USESHOWWINDOW info.wShowWindow = subprocess.SW_HIDE
3
3563
by: =?Utf-8?B?UGVycmlud29sZg==?= | last post by:
Not sure where to post this... Found some interesting behavior in Windows Search (Start =Search =All files and folders =search for "A word or phrase in the file:"). This applies to XP and maybe other Windows flavors. Procedure: 1. Create a simple text file named test.txt. 2. Open the text file in a text editor and add a simple test word such as "blah" (not quotes).
0
9813
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9665
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10835
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10541
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10585
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10249
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9367
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
4447
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4007
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.