Q:

ZendFrameWork mod_rewrite enabled but urls still nor working - wampserver 2.1?

I have enabled enabled mod_rewrite and have the following in httpd.conf:
<Directory />
  Options FollowSymLinks
  AllowOverride all
  Order allow,deny
  Allow from all
</Directory>

I have set up an alias to point to the public folder in the project 127.0.0.1/whatford/
But i still have to prefix my url with index.php to access other controller/views example = 127.0.0.1/whatford/index.php/contact - instead of 127.0.0.1/whatford/contact ?
Any help would be appreciated thanks

A:

Try working with a vhost.
Here are settings you can try based on a domain name test.local
So if you're using Windows update C:\Windows\System32\drivers\etc\hosts by adding the domain like this:
# Copyright (c) 1993-2009 Microsoft Corp.
#
# This is a sample HOSTS file used by Microsoft TCP/IP for Windows.
#
# This file contains the mappings of IP addresses to host names. Each
# entry should be kept on an individual line. The IP address should
# be placed in the first column followed by the corresponding host name.
# The IP address and the host name should be separated by at least one
# space.
#
# Additionally, comments (such as these) may be inserted on individual
# lines or following the machine name denoted by a '#' symbol.
#
# For example:
#
#      102.54.94.97     rhino.acme.com          # source server
#       38.25.63.10     x.acme.com              # x client host

# localhost name resolution is handled within DNS itself.
    127.0.0.1       localhost 
    127.0.0.1       test.local

And if you're using Apache under Windows update the httpd-vhosts.conf file like this (Make sure you put in the correct folder name under DocumentRoot and Directory):
#
# Virtual Hosts
#
# If you want to maintain multiple domains/hostnames on your
# machine you can setup VirtualHost containers for them. Most configurations
# use only name-based virtual hosts so the server doesn't need to worry about
# IP addresses. This is indicated by the asterisks in the directives below.
#
# Please see the documentation at 
# <URL:http://httpd.apache.org/docs/2.2/vhosts/>
# for further details before you try to setup virtual hosts.
#
# You may use the command line option '-S' to verify your virtual host
# configuration.
#
# Use name-based virtual hosting.
#
# NameVirtualHost *:80
#
# VirtualHost example:
# Almost any Apache directive may go into a VirtualHost container.
# The first VirtualHost section is used for all requests that do not
# match a ServerName or ServerAlias in any <VirtualHost> block.

<VirtualHost *:80>
    ServerAdmin webmaster@dummy-host.example.com
    DocumentRoot "C:\www\yourProjectApplicationFolder\public"
    ServerName test.local
    <Directory C:\www\yourProjectApplicationFolder\public>
    Options Indexes FollowSymLinks
    AllowOverride All
    allow from all
    </Directory>
</VirtualHost>

You'll need to make sure you uncomment the
#Include conf/extra/httpd-vhosts.conf

line in the Apache httpd.conf file so it looks like this:
Include conf/extra/httpd-vhosts.conf

Then restart Apache and go to http://test.local and you should have your start page.
Let me know if that works for you or if you run into any more problems.
Cheers,
Dave

A:

I use this : $_SERVER["REQUEST_URI"] = str_replace('index.php','',$_SERVER["REQUEST_URI"]);
added to the top of my index.php to get rid of the index.php in the url.
also check out this Vhost in Zend Server, following along with this post you can make sure your apache setup is correct for ZF, even if you don't setup a full Vhost.

