How to Hide a File Name in the Address Bar
- 1). Open a text editor such as Notepad on Windows.
- 2). Type, or copy and paste, the following into a blank document:
RewriteEngine on
RewriteRule ^old\.html$ new.html - 3). Replace "old\.html" with the file name you are trying to hide. For example, if you want to hide "page.html," type "page\.html." The backslash instructs the server to treat the period between the file name and type as a regular character.
- 4). Replace "new.html" with a new file name such as "new.html" or directory such as "/directory." You do not need to include the backslash in this expression.
- 5). Open the file menu and choose the option to save. In the dialog box, type "htaccess" as the file name and select "txt" as the file type.
- 1). Connect to your Web server. If using FTP, launch your FTP program on your computer and enter your login credential and server information before pressing "Connect."
- 2). Navigate to the directory that contains the file whose name you wish to hide in the "Remote Server" pane of your FTP client.
- 3). Open the folder on your computer that contains "htaccess.txt" in the "Local" pane of your program.
- 4). Double-click the file or right-click and choose "Upload" to upload it.
- 5). Right-click on the file in the remote pane and choose the option to rename it. Change the name to ".htaccess." The file may become hidden, depending on your server and FTP client settings. When users access the old URL, they will now see the new URL in their browser address bar.