/    Sign up×
Community /Pin to ProfileBookmark

[RESOLVED] parse files without a php extension / hiding extension in URL

Is there a nifty trick to parse files without a php extension or hide the .php extension in URL

Need to make a url like:

[url]http://www.mydomain.tld/support[/url]

just to make it friendly for a customer to type it in. Now I have considered a redirect, but a redirect isn’t a script I would really like to write and a server redirect isn’t dynamic.

Is there any other way? I just don’t know how I am going to get it recognized as a php file or script if I didn’t call it as one.

Thanks in Advanced

MarkBad

to post a comment
PHP

3 Comments(s)

Copy linkTweet thisAlerts:
@UltimaterAug 08.2006 — Create a file called htaccess.txt and write this in it:
<i>
</i>DirectoryIndex mypage.php

Upload the file to your FTP's "/support" directory. Then rename the file

from:
htaccess.txt
into:
.htaccess
No, that is not a typeo. Special files have a leading period and no file name -- only an extension.

Now whenever someone browses to the page http://www.mydomain.tld/support it will be the same as entering http://www.mydomain.tld/support/mypage.php
Copy linkTweet thisAlerts:
@UltimaterAug 08.2006 — (ignore this post, this was a double post from server lag -- please delete)
Copy linkTweet thisAlerts:
@Markbad311authorAug 08.2006 — Thank you very much.
×

Success!

Help @Markbad311 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 6.17,
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: @nearjob,
tipped: article
amount: 1000 SATS,

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

tipper: @meenaratha,
tipped: article
amount: 1000 SATS,
)...