dare87 Posted October 27, 2009 Share Posted October 27, 2009 what would you need to place in the htaccess file so that it showed www.domain.com and not www.domain.com/something.php ? I've looked at iframes, but don't want to use that solution. Is there another way to do it? Quote Link to comment https://forums.phpfreaks.com/topic/179150-htaccess/ Share on other sites More sharing options...
cags Posted October 27, 2009 Share Posted October 27, 2009 Difficult to say, your description is a little vague. Do you wish the user to type www.domain.com into the address bar and the viewer to actually see the file www.domain.com/something.php? If so then you could simply place... DirectoryIndex something.php ... in your htaccess file. Quote Link to comment https://forums.phpfreaks.com/topic/179150-htaccess/#findComment-945268 Share on other sites More sharing options...
dare87 Posted October 27, 2009 Author Share Posted October 27, 2009 on the main index page I am going to have a form input box where they can type a name. When they click submit it will take them to www.domain.com/WHATTHEYTYPED I just don't want them to know that it's simply a sub directory. Quote Link to comment https://forums.phpfreaks.com/topic/179150-htaccess/#findComment-945458 Share on other sites More sharing options...
cags Posted October 27, 2009 Share Posted October 27, 2009 Something like... Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RedirectRule ^(.*)$ /$1.php Quote Link to comment https://forums.phpfreaks.com/topic/179150-htaccess/#findComment-945470 Share on other sites More sharing options...
dare87 Posted October 27, 2009 Author Share Posted October 27, 2009 Could you explain how it works please? Something like... Options +FollowSymLinks RewriteEngine On RewriteCond %{SCRIPT_FILENAME} !-d RewriteCond %{SCRIPT_FILENAME} !-f RedirectRule ^(.*)$ /$1.php Quote Link to comment https://forums.phpfreaks.com/topic/179150-htaccess/#findComment-945474 Share on other sites More sharing options...
cags Posted October 27, 2009 Share Posted October 27, 2009 if a filename/directory requested doesn't exist then it forwards to http://www.example.com/requested_file_name.php Quote Link to comment https://forums.phpfreaks.com/topic/179150-htaccess/#findComment-945485 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.