I wanted to test my website offline, but this is my problem:
How can I test
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]
offline?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I understood correctly the question, all you have to do is make sure that the name of your website points to your local PC/Server. Here’s how to do it in OSX, with the following assumptions:
– You will be pointing to your local machine, with address 127.0.0.1
– Your domain name is yourdomain.com.
Replace the above with appropriate values.
How to edit the host file in OSX
sudo nano /private/etc/hosts127.0.0.1 yourdomain.com127.0.0.1 www.yourdomain.comdscacheutil -flushcacheNow, every time you try to open yourdomain.com, it will try to connect to your local machine. To undo the above, simply open the file again and comment out (or delete) the lines you added, then flush the DNS cache.