xxqtony Posted July 17, 2013 Share Posted July 17, 2013 Hope this is the right forum for my question. I have a php page, say named myInstance.com/excellent.php. The page used to work when user type the following to the browser address bar: myInstance.com/excellent (i.e., no dot php) Recently the server is somehow modified by someone, and now I need type myInstance.com/excellent.php (i.e., with dot php) in order to access the page. Not sure if it has anything to do with apache server. Anybody know what was changed and how I can get the address without dot php working again (because many people bookmarked the page with the address without dot php)? Thanks a lot! -tx Quote Link to comment Share on other sites More sharing options...
requinix Posted July 17, 2013 Share Posted July 17, 2013 (edited) Probably MultiViews. In your .htaccess, Options +MultiViewsIt allows you to omit extensions from files that Apache recognizes. Edited July 17, 2013 by requinix Quote Link to comment Share on other sites More sharing options...
xxqtony Posted July 17, 2013 Author Share Posted July 17, 2013 Probably MultiViews. In your .htaccess, Options +MultiViewsIt allows you to omit extensions from files that Apache recognizes. where this .htaccess file should be? should I create a file and add Options +MultiViews to it and put the file in the excellent.php directory? thanks. Quote Link to comment Share on other sites More sharing options...
fastsol Posted July 18, 2013 Share Posted July 18, 2013 Probably MultiViews. In your .htaccess, Options +MultiViewsIt allows you to omit extensions from files that Apache recognizes. That is a cool trick! Is that how many of the big sites do it when they say go to www.example.com/contact or something like that? Quote Link to comment Share on other sites More sharing options...
requinix Posted July 18, 2013 Share Posted July 18, 2013 where this .htaccess file should be? should I create a file and add Options +MultiViews to it and put the file in the excellent.php directory? thanks.Probably in the root of your website, but at the least in the same directory as the script. (Which are apparently the same.) That is a cool trick! Is that how many of the big sites do it when they say go to www.example.com/contact or something like that?Generally not: bigger sites tend to use more sophisticated setups than letting Apache execute individual PHP scripts directly. Like they'll have something configured that says the "/contact" URL executes through a certain OOP class - not actually a particular .php file. Think of it as URL rewriting done with PHP code instead of with mod_rewrite. Quote Link to comment 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.