0

I am running MAMP server Apache Port 80 and MySQL Port 3306. I am using 5.6.25 of PHP version.

When I hit the base URL say http://localhost/ahd/ , the page loads at least. But, when I click on any tab on my website say http://localhost/ahd/Contact-Us , I get the below error:

Not Found

The requested URL /main.php was not found on this server.

I tried changing RewriteEngine On to RewriteEngine Off in .htaccess but then the error becomes

Not Found

The requested URL /ahd/Contact-Us was not found on this server.

I have been struggling with this since a long time, any help would be highly appreciated. Thanks in advance.

Deepak Agrawal
  • 290
  • 1
  • 5
  • 14
  • can you provide some code? your question is very broad – Ahmad Mobaraki Dec 26 '16 at 09:18
  • the problem could be lots of things – Ahmad Mobaraki Dec 26 '16 at 09:20
  • You need to make sure that you have `Options +AllowOverrides` in your httpd config file and that you have the correct `index` file set to whatever your index page is -- altho providing more information like what CMS platform your using etc etc would be helpful. – mike510a Dec 26 '16 at 10:20
  • @mike510a This is the content of "/Applications/MAMP/conf/apache/httpd.conf" file ::: Options Indexes FollowSymLinks AllowOverride None – Deepak Agrawal Dec 26 '16 at 13:54
  • @AhmadMobaraki :Which piece of code will be helpful. It is not a code issue because the site is working flawlessly on GoDaddy server. It is the local set up which has issues. URL : http://www.assignmenthelpdesk.com/ – Deepak Agrawal Dec 26 '16 at 14:08
  • 1
    is this the first time you running the site on local? maybe you need to configure a virtual host on mamp to simulate GoDaddy server exactly – Ahmad Mobaraki Dec 26 '16 at 14:25
  • @AhmadMobaraki. Thank you for your reply. Yes, you are right. This is the first time I am running the site on local. Could you please elaborate more on your resolution step above. How do I configure a virtual host on MAMP? – Deepak Agrawal Dec 26 '16 at 14:48
  • there are lots of tutorial about this, these links maybe helpful: http://foundationphp.com/tutorials/vhosts_mamp.php and http://stackoverflow.com/questions/35251032/how-to-create-virtual-hosts-in-mamp – Ahmad Mobaraki Dec 26 '16 at 15:09
  • I think by creating a virtual host for your site the problem will be solved – Ahmad Mobaraki Dec 26 '16 at 15:11
  • @AhmadMobaraki : Thank you for pointing to the link. I am just thinking loudly. Virtual hosts are used when you need to maintain more than 1 domain/host. In my case, all my files are in /Applications/MAMP/htdocs folder only (/Applications/MAMP/htdocs/ahd) and I will be using localhost only at the end of the day, like http://localhost/ahd . Just sharing with you : My another website works fine with localhost say http://localhost/anotherWebsite. Do you think I need virtual hosts? – Deepak Agrawal Dec 26 '16 at 15:20
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/131519/discussion-between-deepak-and-ahmad-mobaraki). – Deepak Agrawal Dec 26 '16 at 15:26

0 Answers0