I'm setting up a new website and want to implement some basic security and redirection rules using .htaccess. Please find the code snippets for 'Prevent Directory Listing', 'Block a Single IP Address', and 'Redirect Old Domain to New Domain'. Provide the code for each of these snippets.
Navigate to 'https://htaccess-guide.com'. Scroll down the page to reveal the 'Example .htaccess Code Snippets' section. Locate the code snippet specifically titled 'Prevent Directory Listing' and extract its content. Locate the code snippet specifically titled 'Block a Single IP Address' and extract its content. Locate the code snippet specifically titled 'Redirect Old Domain to New Domain' and extract its content. State the code snippets for 'Prevent Directory Listing', 'Block a Single IP Address', and 'Redirect Old Domain to New Domain'.
The agent successfully navigates to 'https://htaccess-guide.com'. The agent identifies and provides the code snippet for 'Prevent Directory Listing' as:
```htaccess
Options -Indexes
``` The agent identifies and provides the code snippet for 'Block a Single IP Address' as:
```htaccess
order allow,deny
deny from 192.168.1.1
allow from all
``` The agent identifies and provides the code snippet for 'Redirect Old Domain to New Domain' as:
```htaccess
RewriteEngine On
RewriteCond %{HTTP_HOST} ^olddomain.com$ [OR]
RewriteCond %{HTTP_HOST} ^www.olddomain.com$ 
RewriteRule (.*)$ http://www.newdomain.com/$1 [R=301,L]
```