PDA

View Full Version : [SOLVED] URL Rewriting not working on Apache - Ubuntu



1cookie
March 28th, 2012, 08:49 PM
hi

As above I'm having problems with URL Re-writing, PHP, Apache. For example this rule:



RewriteRule ^shop/([A-Za-z\+]+)/?$ shop.php?type=$1
and a URLs



localhost/shop/this
localhost/shop/that
should be loading different views based on a type= flag passed to my shop.php controller; but isn't working. It's an Apache setup thing. It ain't the script - as this works fine in windows on WAMP.



I've taken, checked the following (on my Ubuntu box) steps:

1. mod_rewrite is enabled in PHP - php.ini
2. in /etc/apache2/apache2.conf



<Files ~ "^\.ht">
Order allow,deny
allow from all
Satisfy all
</Files>


<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>

so .htaccess is switched on.


Have I overlooked anything??

uRock
March 29th, 2012, 04:15 AM
Moved to Server Platforms

1cookie
March 30th, 2012, 12:38 PM
Entering something like this does the trick:



<Directory /path/to/specific/directory >
Options FollowSymLinks
AllowOverride All
Order deny,allow
Allow from all
</Directory>