chantown Posted December 23, 2007 Share Posted December 23, 2007 Let's say i have my hyperlink to index.php, but when people click on it, i just want them to see the "domain.com", not "domain.com/index.php" is there anyway to get rid of it? Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/ Share on other sites More sharing options...
redarrow Posted December 23, 2007 Share Posted December 23, 2007 need to setup apache properly or use .htaccess by defualt in the htdocs a index.php file shouldnt be showing as youve said....... Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421534 Share on other sites More sharing options...
chantown Posted December 23, 2007 Author Share Posted December 23, 2007 well, i have a link to index.php, so by default when people click it , it SHOULD show, right? Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421553 Share on other sites More sharing options...
freebsdntu Posted December 23, 2007 Share Posted December 23, 2007 I guess you just need to configure your apache,then it will be fine Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421568 Share on other sites More sharing options...
eRott Posted December 23, 2007 Share Posted December 23, 2007 What he means (i think) is not the directory listing. He is referring to the URL. Currently, my URL bar shows: http://www.phpfreaks.com/forums/index.php?action=post;topic=173395.0;num_replies=3 What the OP was looking for is how to hide everything after his TLD, so while the user is still navigating the page: http://www.phpfreaks.com/forums/index.php?action=post;topic=173395.0;num_replies=3 It would only look like: http://www.phpfreaks.com/ And to answer your question. I have no idea. Take care. Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421586 Share on other sites More sharing options...
redarrow Posted December 23, 2007 Share Posted December 23, 2007 rewrite_url http://www.sitepoint.com/article/guide-url-rewriting Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421589 Share on other sites More sharing options...
juapo2 Posted December 23, 2007 Share Posted December 23, 2007 I think you should just use "Cloaking" for your domain, and it will instead of show eg. www.mydomain.com/index.php, it will show www.mydomain.com. But even though it is very good, but i has some bad things of using it, if you have different titles in each page, you will have just a static one for all the pages. So good Luck, try doing what i told ya Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421600 Share on other sites More sharing options...
chantown Posted December 23, 2007 Author Share Posted December 23, 2007 i'm gonna take a look at mod rewrite but it's not a big deal right? (i just thought that most mainstream websites dont show the index.php) Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421620 Share on other sites More sharing options...
eRott Posted December 23, 2007 Share Posted December 23, 2007 On the contrary, I think most do not cloak or mask the URL's. I wouldn't be too concerned with it if i were you. Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421637 Share on other sites More sharing options...
thebadbad Posted December 23, 2007 Share Posted December 23, 2007 Oh my, this is so simple. Just link to "/" (the root). It should run the index.php by default. <a href="/">To the frontpage</a> Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421692 Share on other sites More sharing options...
eRott Posted December 23, 2007 Share Posted December 23, 2007 thebadbad, If you read the origional post and the ones after it, you would have realized, what you wrote was not what the OP was looking for. It had nothing to to with adding a hyperlink VIA HTML to his website. Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421910 Share on other sites More sharing options...
corbin Posted December 23, 2007 Share Posted December 23, 2007 You could use a giant frame..... But that would be kinda.... bleh. Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421934 Share on other sites More sharing options...
anon Posted December 23, 2007 Share Posted December 23, 2007 Having your URL only being your domain is not a good idea. Why not just configure .htaccess to make /index.php the home page? Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421946 Share on other sites More sharing options...
ohdang888 Posted December 23, 2007 Share Posted December 23, 2007 why waste the time? Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421952 Share on other sites More sharing options...
Xyphon Posted December 23, 2007 Share Posted December 23, 2007 Insted of going <a href='index.php'> Blah</a> Do this <a href='http://www.yourdomain.com'> Blah</a> That will send a direct link you your index, but wont have /index.php at the end. Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421957 Share on other sites More sharing options...
thebadbad Posted December 23, 2007 Share Posted December 23, 2007 thebadbad, If you read the origional post and the ones after it, you would have realized, what you wrote was not what the OP was looking for. It had nothing to to with adding a hyperlink VIA HTML to his website. I read them, thank you. After reading his second post it still seems like I was perfectly on the point? Although it's unclear if he wants /index.php to redirect to /. Let's wait for his answer (i just thought that most mainstream websites dont show the index.php) That's because they never visually link to it. Instead link to the root "/" as I suggested. Apache will default to index.php, without showing the index.php in the browser's location bar. If you want to achieve something different, please elaborate. Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421970 Share on other sites More sharing options...
juapo2 Posted December 23, 2007 Share Posted December 23, 2007 Yes, you can instead of hoing into the index.php, write on your browser: http://www.mydomain.com This will take to http://www.mydomain.com/index.php Try it man Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-421973 Share on other sites More sharing options...
tbare Posted December 24, 2007 Share Posted December 24, 2007 what if u make the link 'http://www.domain.com' instead of 'index.php'... should do what u want..?? Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-422059 Share on other sites More sharing options...
MasterACE14 Posted December 24, 2007 Share Posted December 24, 2007 (i just thought that most mainstream websites dont show the index.php) This isn't particularly true, Google, PHP Freaks, Youtube.... they do tend to hide the actual page you are on, but they dont hide the GET variables and what not after the domain name. One of the main reasons for just showing your domain name instead of the full URL is to hide URL's that contain GET variables in them which can be bookmarked and reused later. For example, say someone made a website with a login form which uses a GET( EXTREMELY bad thing to do) and you happened to be behind someone at a internet cafe who is login into the website. They get up for a moment and ask for help at the counter. Then you quickly jump onto the PC, save the current URL to favourites. They come back, they stay for 20 mins then leave, you jump onto that PC and go to favourites and load the URL. and alakazam, your logged into there account. This is a REALLY UNLIKELY TO HAPPEN, but hey, anything is possible. I just had to explain what the whole point of hiding a URL is for lol Note: that is only one reason/example to hide the URL. Regards ACE Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-422067 Share on other sites More sharing options...
chantown Posted December 24, 2007 Author Share Posted December 24, 2007 thank you all, after some thinking, i realize that this isn't even a big problem. Who cares if i show index.php? haha but yes what i was trying to get at was just <a href="/">Link</a> That does work, i believe, just didnt thought it would thanks all Quote Link to comment https://forums.phpfreaks.com/topic/82883-how-do-i-get-rid-of-the-indexphp/#findComment-422168 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.