Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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().

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
526 views
Welcome To Ask or Share your Answers For Others

1 Answer

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

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...