I want to hide the URL of my PHP page; that is, I don't want to write /register.php directly in the href tag, I want to write /register/ and have it open the register.php page directly. I want to do that for all the webpages.
-
1You can probably use URL rewriting; what webserver are you using?Michael Mrozek– Michael Mrozek2010-06-09 15:34:25 +00:00Commented Jun 9, 2010 at 15:34
-
ok...I am using domain services from justhost. I think they are providing apache webserver.manoj singhal– manoj singhal2010-06-09 15:57:03 +00:00Commented Jun 9, 2010 at 15:57
Add a comment
|
4 Answers
umm quick fix is to make a directory called register and save it as the index.php then make sure all your forms have action="/register/" (assuming register is a root folder of domain)
4 Comments
Michael Mrozek
It sounds like he has a number of pages; he just wants
/foo/ to redirect to /foo.php for any foomanoj singhal
Hello, I have written code for this... <p class="text13"><a rel="nofollow" href="/register/">Register</a></p> This is not working...saying page not found. I have created a folder called register and inside the folder i have index.php file. Also tell me if I want to open another page inside the same folder how can i do without writting the extension. Thanks, Manoj
manoj singhal
Check the website phpclasses.byting.at/browse they are opening a page with the help of the folder name....
Carter Cole
if you want to use more than one script your going to want to use the .htaccess method described above
Rest easy .. I am new to web development also and I had trouble making this solution work. The detail that is not obvious is that in the php code links, you should remove the extension. For example :
<li><a href="index.php">Home</a></li>
should read
<li><a href="index">Home</a></li>
Then the extension goes away.