16
Quote:
Bender wrote:
(ever tried to create a file named .htaccess under windows ... well thats why i can´t test it here with xampp and my sites are all shared hosting so i have no access to httpd.conf.
To use .htaccess and mod_rewrite with XAMPP, you have to edit xampp/apache/conf/http.conf
1) Check around line 221 the entry:
AddType application/x-httpd-php .php .php3 .phtml
and make sure the .phtml extension is present.
2) Around line 414, check that the entry specifies the .htaccess file:
AccessFilename .htaccess
3) Around line 166, uncomment the Line:
#LoadModule rewrite_module modules/mod_rewrite.so
4) Check the entry around line 362. If it reads:
AllowOverride None
change it to:
AllowOverride All
You need to re-start the Apache server for the effects to take place.
Mod_rewrite may already be enabled on your shared server. Not all hosts allow you to create .htaccess files, but if yours does, upload two files - test1.html and test2.html - and place a simple .htaccess file in the same folder. The contents should read:
# Test rewrite is on
RewriteEngine On
RewriteRule ^test1.html$ /test2.html [R=301]
#
If you then enter the URL to test1.html in a browser and wind up looking at test2.html... it's working.
A thread is for life. Not just for Christmas.