/    Sign up×
Community /Pin to ProfileBookmark

how php pages works when removing extension

Hi
i see some sites that are builded with php and when navigating inside the site i didn’t see any page have extension .php !! how ?!

thanks in advance.

to post a comment
PHP

6 Comments(s)

Copy linkTweet thisAlerts:
@NogDogSep 10.2007 — Probably by using Apache's mod_rewrite functionality.
Copy linkTweet thisAlerts:
@LeeUSep 10.2007 — Here is one method.
Copy linkTweet thisAlerts:
@bokehSep 10.2007 — Mod_negotiation (MultiViews):[I]

If the server receives a request for /some/dir/foo and /some/dir/foo does not exist, then the server reads the directory looking for all files named foo.*, and effectively fakes up a type map which names all those files, assigning them the same media types and content-encodings it would have if the client had asked for one of them by name. It then chooses the best match to the client's requirements, and returns that document. [/I]
Copy linkTweet thisAlerts:
@decibelSep 10.2007 — The use of mod_rewrite, as the tutorial explains, allows you to use one file (index.php) to configure your page framework... this is very powerful once you understand it well.

I use it to dispatch page objects from the url, process my php logic code, and then display a page by executing $smarty templates.

This is a similar paradigm to java/jsp.
Copy linkTweet thisAlerts:
@secoauthorSep 10.2007 — Mod_negotiation (MultiViews) way doesn't shows a way to do it

does any body have idea?
Copy linkTweet thisAlerts:
@bokehSep 10.2007 — [CODE]<Directory />
Options Indexes FollowSymLinks [B][COLOR="Red"]MultiViews[/COLOR][/B] ExecCGI
AllowOverride None
Order deny,allow
Deny from all
Satisfy all
</Directory>[/CODE]
In httpd.conf
×

Success!

Help @seco spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.19,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...