Ich suche nun schon eine Weile, wie .htaccess-Dateien in MAMP 2.1.2 aktiviert werden können
Ich habe folgende Einstellungen:
httpd.conf
LoadModule rewrite_module modules/mod_rewrite.so
...
#
# DocumentRoot: The directory out of which you will serve your
# documents. By default, all requests are taken from this directory, but
# symbolic links and aliases may be used to point to other locations.
#
# MAMP DOCUMENT_ROOT !! Don't remove this line !!
DocumentRoot "/Applications/MAMP/htdocs"
#
# Each directory to which Apache has access can be configured with respect
# to which services and features are allowed and/or disabled in that
# directory (and its subdirectories).
#
# First, we configure the "default" to be a very restrictive set of
# features.
#
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
</Directory>
#
# Note that from this point forward you must specifically allow
# particular features to be enabled - so if something's not working as
# you might expect, make sure that you have specifically enabled it
# below.
#
#
# This should be changed to whatever you set DocumentRoot to.
#
<Directory "/Applications/MAMP/htdocs">
#
# Possible values for the Options directive are "None", "All",
# or any combination of:
# Indexes Includes FollowSymLinks SymLinksifOwnerMatch ExecCGI MultiViews
#
# Note that "MultiViews" must be named *explicitly* --- "Options All"
# doesn't give it to you.
#
# The Options directive is both complicated and important. Please see
# http://httpd.apache.org/docs/2.2/mod/core.html#options
# for more information.
#
Options All
#
# AllowOverride controls what directives may be placed in .htaccess files.
# It can be "All", "None", or any combination of the keywords:
# Options FileInfo AuthConfig Limit
#
AllowOverride All
#
# Controls who can get stuff from this server.
#
Order allow,deny
Allow from all
</Directory>
...
#
# DirectoryIndex: sets the file that Apache will serve if a directory
# is requested.
#
<IfModule dir_module>
DirectoryIndex index.html index.php
</IfModule>
#
# AccessFileName: The name of the file to look for in each directory
# for additional configuration directives. See also the AllowOverride
# directive.
#
AccessFileName .htaccess
Die .htaccess-Datei (Sie arbeiten bereits auf der Online-Website):
RewriteEngine on
RewriteRule ^([a-z\-]+)$ /index.php?page=$1 [L]
Und die Seitenausgabe, wenn ich zu / foo navigiere
Not Found
The requested URL /index.php was not found on this server.
Ich habe versucht, die folgende Zeile in die .htaccess-Datei einzufügen Da sich meine Website befindet: localhost / mysite / hatte jedoch keine Auswirkungen.
RewriteBase /mysite/
Zugriff auf localhost / mysite / index.php? Page = foo funktioniert.
irgendwelche Ideen?