Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

.htaccess doesn't work on xampp (windows 7)

I'm setting my .htaccess file right now to use friendly urls (manually). But, when i go to the url the server shows me Error 404.

RewriteEngine on

RewriteCond %{SCRIPT_FILENAME} !-d  
RewriteCond %{SCRIPT_FILENAME} !-f  

Rewriterule ^register$ register.php 

I'm really sure that mod_rewrite is enabled because i see it when use phpinfo().

like image 464
Jhonatan Sandoval Avatar asked Jun 29 '14 01:06

Jhonatan Sandoval


1 Answers

Even though mod-rewrite is enabled, by default it is not enabled for .htaccess files.

Hold Your Breath

  • Open xampp control panel
  • Stop Apache
  • Click the Config button on the Apache row, and select httpd.conf
  • In that file, search for something like xampp/htdocs">
  • A bit lower, you may see a line like this: # AllowOverride All. Remove the #, which is a comment
  • Alternately, search for AllowOverride All, make sure it is in the right section, and remove the comment #
  • Save the file
  • Restart Apache, say a prayer, cross your fingers and hold your breath
like image 100
zx81 Avatar answered Sep 16 '22 19:09

zx81