?
Solved

How to enable the mod_rewrite option in your Apache configuration for MAMP on MAC

Posted on 2015-01-12
2
Medium Priority
?
2,026 Views
Last Modified: 2015-01-13
Hi Experts,

I am trying to setup an application on MAMP, my localhost..using Macbook pro...trouble is when i try to access the application, the links are showing e.g. localhost/stayzed/index.php, instead of localhost:8888/stayzed/index.php   ....I got a response from developer saying I should do the following:

As you have mentioned we have shared the steps to the Issue of .htaccess file.

Please enable the mod_rewrite option in your Apache configuration.

If you're already enabled mod_rewrite option please use the below lines,

RewriteEngine ON
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#RewriteRule .* index.php/$0 [PT,L]
RewriteRule ^(.*)$ /index.php?q=$1 [L,QSA]

in your .htaccess file (Path: root_folder/.htaccess).

Hope the experts can help resolve this.

Regards
0
Comment
Question by:kasondeneddy
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 51

Accepted Solution

by:
Steve Bink earned 2000 total points
ID: 40546839
Have you tried a2enmod?  If you don't have a2enmod installed with your package, you'll need to edit the service's conf files to include this line somewhere:
LoadModule rewrite_module /path/to/mod_rewrite.so

Open in new window

Chances are, your installation already has a file prepared with this declaration, and it just needs to be enabled.  In Ubuntu/Debian systems, this is accomplished by manipulating the mods-enabled/mods-available directories under Apache's server root - just symlink mods-available/rewrite.conf to mods-enabled/rewrite.conf.

In any case, after you enable the mod, remember to restart Apache.
0
 

Author Closing Comment

by:kasondeneddy
ID: 40547045
Perfect explanation..
0

Featured Post

Plug and play, no additional software required!

The ATEN UE3310 USB3.1 Gen1 Extender Cable allows users to extend the distance between the computer and USB devices up to 10 m (33 ft). The UE3310 is a high-quality, cost-effective solution for professional environments such as hospitals, factories and business facilities.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Nothing in an HTTP request can be trusted, including HTTP headers and form data.  A form token is a tool that can be used to guard against request forgeries (CSRF).  This article shows an improved approach to form tokens, making it more difficult to…
Introduction This article is intended for those who are new to PHP error handling (https://www.experts-exchange.com/articles/11769/And-by-the-way-I-am-New-to-PHP.html).  It addresses one of the most common problems that plague beginning PHP develop…
The viewer will learn how to count occurrences of each item in an array.
The viewer will learn how to create and use a small PHP class to apply a watermark to an image. This video shows the viewer the setup for the PHP watermark as well as important coding language. Continue to Part 2 to learn the core code used in creat…
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question