I am trying to make an address book CRUD application. When I finished creating the Model and the CRUD application, I entered the address and I get a 404 error. (I will include and image at the end of this post in case you all need to see it.) I entered the correct information in the Model Generator and the CRUD Generator. (I will also include these images.) I am working on a localhost(XAMPP). What am I doing wrong?
What you posted in what should go into the local .htacess file - put one in yoursite/web.
What you need to do with Apache global config is to slightly modify the default site to point to your directory, and then leave the rest as is - that is, no rewrite directives, only options, allowoverride - what the configuration was before you changed it.
I followed your instructions and I got a HTTP 500 error. The only thing is my whole web application is broke now. I will include what my http.conf and my .htaccess file looks like.
# use mod_rewrite for pretty URL support
RewriteEngine on
RewriteBase /
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
# ...other settings...
</Directory>
With the code setup, I get a HHTP 500 error. So do I need to run "yii serve --port=8888" now?
DocumentRoot "/Applications/XAMPP/xamppfiles/htdocs/basic/web/"
<Directory "/Applications/XAMPP/xamppfiles/htdocs/basic/web/">
Options Indexes FollowSymLinks
AllowOverride All
Order allow,deny
Allow from all
</Directory>
.htaccess
# use mod_rewrite for pretty URL support
RewriteEngine on
RewriteBase /
# If a directory or a file exists, use the request directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
# Otherwise forward the request to index.php
RewriteRule . index.php
Put .htaccess in “/Applications/XAMPP/xamppfiles/htdocs/basic/web” if it’s not already there.
I am actually just using a MAC and running XAMPP and that’s it. I did get the HTTP 500 error resolved but I still have the 404 error on my address book. I also was able to get PrettyURLs to work properly. Do you have any other solutions to resolving my 404 error?