![]() You can run it anywhere with Windows, such as local disk, USB Flash disk, mobile HD…, or even web disk supporting synchronization like Dropbox. USBWebserver is a super fast, convenient and portable WAMP website testing environment from Netherlands. If you’re a web developer or learning web programming languages, you must found that: every time want to perform local debugging, testing for your web app/code on a new OS or another PC, you has to set up and configure the whole AMP (Apache, PHP, MySQL) web development environments from scratch, which is absolutely boring. The configuration below redirects all requests for nonexistent documents to a page in the project root directory called 404.html. htaccess settings to let Apache know what error page you would like displayed whenever a user attempts to access a nonexistent page. However, most sites provide a customized error page. By default, Apache displays an error page in the event of a 404 error. It is important that users receive feedback explaining the error. ![]() When a visitor attempts to access a page or resource that doesn’t exist (for example by following a broken link or typing an incorrect URL,) the server responds with a 404 error code. You should see the url redirect to /test1/index.html in the address bar, and your test html file should be displayed. In this case, the traffic is being redirected to /test1/index.html for this second parameter a Unix path or HTTP URL is acceptable. The final parameter indicates where you want the visitor to be redirected. ![]() htaccess file where the redirect configuration is set up. This parameter requires that it is a Unix path and not a URL. The next parameter is the Unix path to the file that is requested in the URL. ![]() Specifying 301 makes it clear that the page at the requested location has permanently moved to a new location. If you leave this parameter blank, it defaults to a 302 code indicating that the redirect is temporary. Specifying a status code is helpful for letting the browser know that the page has been moved to a new location. The first parameter after the ‘Redirect’ command is the HTTP status code. Redirect 301 /main.html /test1/index.html htaccess file to disable directory listings. One way to restrict a directory listing is through Apache’s. This way only site visitors that are familiar with your site’s directory and file structure can locate and access site files that you do not directly provide links to. It’s a security best practice to disable the directory listing generated by the mod_autoindex module. If this file is not present, and the mod_autoindex module is installed and enabled, Apache automatically generates a directory listing for the given URL. Typically, Apache is configured to use a file named index.html as the source for a directory listing. sudo nano /var/Disable Directory Listings in ApacheĪpache’s mod_autoindex module generates a directory listing for any URL that does not contain a directory index file. If you followed the steps in one of our LAMP stack guides, your root folder is located in the /var/Replace with the your own site’s domain name. You can place the file in your site’s document root. Use a text editor to create and open the. htaccess files in your Apache configuration file, you can create the. Save the file, then restart apache: sudo service apache2 restart
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |