473,224 Members | 1,504 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,224 software developers and data experts.

Hide Url

Hi all,
I would like to hide my url to other for secuiry purpose.

i have page like:


i dont want to show my users the page extension.i want to show my user:


how can i do this?
Sep 20 '06 #1
7 27175

U do this with the help of .htaccess concept.

U have to define rule that if url is


then its give url http://localhost/cstc/.

Plz. try to use .htaccess concept

Sep 20 '06 #2
I have an option for you..
just replace your url by duplicate url
STEP1 -> take the current url by $_SERVER['PHP_SELF']


Sep 20 '06 #3
here is the code for an .htaccess file to do what youre asking:
Expand|Select|Wrap|Line Numbers
  1. RewriteEngine On
  2. RewriteBase /
  3. RewriteCond    %{REQUEST_FILENAME}  !-f
  4. RewriteCond    %{REQUEST_FILENAME}  !-d
  5. RewriteRule . /index.php [L]
this turns on the mod_rewrite engine in apache, tells what base directory to look in, checks the files to see if they exist, and if they dont, it will default to /index.php and you can use the URL as variable using $_SERVER['REQUEST_URI'] and explode

youll need to do this for each directory you want to have work, otherwise they will all go back to /index.php

good luck,
Sep 23 '06 #4

i am working under windows environment and i am novice in php. i am using apche2traid to run my apache server. i could not catch ur solutions. can anyone help me giving the whole sample code?
Sep 23 '06 #5
http://php.net/htaccess to learn about this in php
http://us2.php.net/reserved.variables and find info on REQUEST_URI

since you are using windows, you cant create a .htaccess file because windows wont allow a file starting with a period. so you need to edit your apache.conf file to look for a different file name than .htaccess.

now that that is ready, creat that file with the info i put in my last post. if your apache document root is c:/php/ then in the .htaccess the / will point to that.

so what the htaccess file does is turns on apache mod_rewrite, and tells it that if the file in the URI doesnt exist (eg: http://localhost/fakedirectory ), it will display your index.php for your document root. if you HAVE a directory called 'fakedirectory', it will show the index.php file for that directory. you can place an htaccess file in fakedirectory as well, and start stacking them up so it wouldnt go back to your document root.

back to using mod_rewrite...

if you have it point back to / and you go to http://localhost/fakedirectory, it will show /index.php and will set the variable $HTTP_SERVER_VARS['REQUEST_URI'] to /fakedirectory. if you went to http://localhost/fakedirectory/anotherfake it would set $HTTP_SERVER_VARS['REQUEST_URI'] to /fakedirectory/anotherfake, which you can then call and explode to break it at the / into seperate vars to work with.

sorry this is wordy, but i dont know how it cant be

Sep 23 '06 #6
Hi guys,
thanks for ur solutions. i got another way to solve the problem. below codes also work. just save the code as index.htm and keep it in the folder. the page name will not show. dont remove the index.php file.

best regards.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Frameset//EN"
<TITLE>Customer Enquiry</TITLE>
<FRAMESET cols="100%">
<FRAME src="http://localhost/cust/index.php">
<P>This frameset document contains:
<LI><A href="http://localhost/cust/">A link to mysite</A>
Sep 24 '06 #7
your html link:
Expand|Select|Wrap|Line Numbers
  1. <a href="www.example.com/item/harddisk">Hard disk</a>
Your .htaccess
Expand|Select|Wrap|Line Numbers
  1. RewriteRule ^item/(.*)$ products.php?name=$1
Your products.php
Expand|Select|Wrap|Line Numbers
  1. $name=$_GET['name']
Jan 10 '14 #8

Sign in to post your reply or Sign up for a free account.

Similar topics

by: Steve | last post by:
Visual Studio 2003 C# Windows: I have a tree view control as my main menu control down the left side of my application. This has 2 Parent Nodes on it (Jobs and Employees). beneath these 2 main...
by: alex | last post by:
I'd like to have a show/hide widget on my web site, kind of like "show details" / "hide details" in Google Groups. Is there a tutorial explaining how to make them? Google's is a bit complex and...
by: Efkas | last post by:
I have a full custom application with some widged extending Controls like Label and PictureBox. I build a menu with these widgets. When I click on one of them, it calls a function to display...
by: FP | last post by:
I'm new to Java Script. I'm displaying comments people have made. Below each persons' comment I want to add 2 buttons "Reply" and "Amend". Clicking "Reply" would display an empty text field...
by: ali | last post by:
Hello every one i need you help regarding div hide and show. i am having a link like <a href="#" onClick="expandWin()">show/hide </a> <div id=showHide> </div> within div i have lots of...
by: pamate | last post by:
hi, I want to show hide layers. I am able to show and hide layers but i am facing problem that, cant view the cursor in Mozilla,but i can type in input text box, its overlapping the layers. ...
by: Ralph | last post by:
Hi, I was reading effictive C++ and some other books again and they all tell you about hiding implementation details (proxy/pimpl/inheritance) but they never really explain when to use it. I...
by: Doogie | last post by:
Hi I have an img control I am trying to hide upon certain types of commands in my code behind. When to hide it is directly tied to a asp:dropdownlist control. So depending on what the user...
by: richard | last post by:
In using the simple code below, how do I tell it NOT to hide a division when the link is clicked on if that division is already visible? would it be as simple as using a 2nd function and setting...
Debadatta Mishra
by: Debadatta Mishra | last post by:
Introduction In this article I will provide you an approach to manipulate an image file. This article gives you an insight into some tricks in java so that you can conceal sensitive information...
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
by: veera ravala | last post by:
ServiceNow is a powerful cloud-based platform that offers a wide range of services to help organizations manage their workflows, operations, and IT services more efficiently. At its core, ServiceNow...
by: jianzs | last post by:
Introduction Cloud-native applications are conventionally identified as those designed and nurtured on cloud infrastructure. Such applications, rooted in cloud technologies, skillfully benefit from...
by: mar23 | last post by:
Here's the situation. I have a form called frmDiceInventory with subform called subfrmDice. The subform's control source is linked to a query called qryDiceInventory. I've been trying to pick up the...
by: abbasky | last post by:
### Vandf component communication method one: data sharing ​ Vandf components can achieve data exchange through data sharing, state sharing, events, and other methods. Vandf's data exchange method...
by: jimatqsi | last post by:
The boss wants the word "CONFIDENTIAL" overlaying certain reports. He wants it large, slanted across the page, on every page, very light gray, outlined letters, not block letters. I thought Word Art...
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....

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.