473,910 Members | 4,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Hide Url

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

i have page like:

http://localhost/cstc/index.php

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

http://localhost/cstc/

how can i do this?
Sep 20 '06 #1
7 27214
hardikmehta
3 New Member
Hello,

U do this with the help of .htaccess concept.

U have to define rule that if url is

http://localhost/cstc/index.php

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

Plz. try to use .htaccess concept

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

STEP2 -> AND REPLACE IT BY YOUR URL(WHICH U LIKE)

bye
pasu
Sep 20 '06 #3
tbb9216
16 New Member
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]
  6.  
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,
-tim
Sep 23 '06 #4
mainul
51 New Member
Hi,

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
tbb9216
16 New Member
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_VA RS['REQUEST_URI'] to /fakedirectory. if you went to http://localhost/fakedirectory/anotherfake it would set $HTTP_SERVER_VA RS['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

-tim
Sep 23 '06 #6
mainul
51 New Member
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"
"http://www.w3.org/TR/html4/frameset.dtd">
<HTML>
<HEAD>
<TITLE>Custom er Enquiry</TITLE>
</HEAD>
<FRAMESET cols="100%">
<FRAME src="http://localhost/cust/index.php">
<NOFRAMES>
<P>This frameset document contains:
<UL>
<LI><A href="http://localhost/cust/">A link to mysite</A>
</UL>
</NOFRAMES>
</FRAMESET>
</HTML>
Sep 24 '06 #7
gurumoorthi
3 New Member
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

5
4516
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 functions I have 2 sub functions under each("Add Job", "View Jobs" and "Add User", "View Users"). I have theses subfunctions grouped in a TabControl, so there are 2 TabControl objects on my main screen, each with 2 pages on. When the user...
3
2959
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 it's easy to get something wrong. If the browser does not support the required features, I want it to generate a completely static page with the "details" shown automatically.
0
2110
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 some stuff in the main display area. The stuff to display is one of many assemblies loaded at the opening of the application by Activator.CreateInstance, because I want it independant of the main application, as a plugin. All assembly are loaded...
7
29158
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 below the comment with a spell check & submit button. Clicking "Amend" would display the same buttons & text field but pre-populated with the original comment. Using Java Script how do I show / hide the text field in my list of comments but have...
5
8445
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 form tags and div elements say n. The problem
1
4185
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. I don`t want to change the way i have used to show and hide layers. check down code :- <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html...
6
3973
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 am starting on a new project which is part library so I think it would be good to hide the implementation for the public classes in the library but this seems a lot of overhead to me (both when developing and runtime overhead).
6
3222
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 selects in that dropdownlist, this image will be hidden or be displayed. I have tied the onselectedindexchanged value of the dropdownlist to a c-sharp method (not javascript) because other things are being done as well that I want to do server side. ...
2
2551
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 that to "display" rather than "none"? For instance, "home" is showing. The user clicks on "home". I don't want the division to do anything at all.
0
10806
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 inside an image, hide your complete image as text ,search for a particular image inside a directory, minimize the size of the image. However this is not a new concept, there is a concept called Steganography which enables to conceal your secret...
0
10037
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
11349
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
10921
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...
0
9727
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
8099
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
7250
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5939
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4776
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
4337
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.