Jump to content

False Directory To Hide .php Extention In Url - Ex: .com/blah/ Not .com/blah.php


Recommended Posts

I've searched google for this and I'm not 100% sure if this is even a .php related request but... I'm attempting to create (for lack of better description) "false directories" that prevent the .php extention from displaying in specific URLs.

 

I'm creating user profiles for my site and rather than display:

.com/u/username.php

I would like to display:

.com/u/username

 

I have a feeling this might be server related. Shot in the dark. Hope someone can shead some light on this for me.

 

Thanks as always!

Well, I'm open for suggestions. I have a directory called

 /u/

and would like the username or profile page not to have a .php extension. I would like to handle this in the most efficient way. Just don't know how to go about it. I read this can be handled in .htaccess but if there is a better way.... I'm open.

 

- Stupid question (avatar) Got it.

Edited by wait

This is now how this is typically done:

 

Ideally you would have one page. say, user.php

 

you would link to that page with a variable, like site.com/user.php?id=135 or site.com/user.php?u=wait

 

you would then use $_GET['id'] and query a database for that members info.

 

 

whichever way, you'll still need mod rewrite to do what you want

Edited by play_
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.