I have a working Magento shop online. I'm trying to make it run locally as a copy for testing purposes. Everything works, except the url rewriting. I've already added the AllowOverride All option to my httpd config file, as everyone here suggested.
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
I also have RewriteEngine on in my .htaccess file (same htaccess as the online website). Still I'm getting the index.php 404 error on every other page than the homepage. http://www.example.com/index.php/randompage however does work. What's also strange is that the same configuration works for developer, but not for me. So it must be something apache specific I guess.
I've tried a lot of given suggestions in similar topics but nothing worked :(
Running macosx 10.9.5
I'm out of ideas. Thanks in advance!
You must have mod_rewrite enabled for apache.
Run a2enmod rewrite and then /etc/init.d/apache2 restart
You can try setting the RewriteBase parameter which may fix the issue.
In the .htaccess file in your Magento root on your local machine, look for the following:
#RewriteBase /magento/
Change it to
RewriteBase /
Related
Oracle Linux 7.3 (RHEL derivative)
Apache 2.4.6
I'm setting up a repository in /srv/www for yum, scripts, and kickstart files, served via httpd. I want an auto-index, so I don't have any index.html. And, this is the only thing this internal server will do. So, httpd.conf:
DocumentRoot "/srv/www"
<Directory "/srv/www">
AllowOverride all
Options Indexes FollowSymLinks
Require all granted
</Directory>
However, I still get the error message:
[autoindex:error] [pid 12345] [client <IP address>:<port>] AH01276: Cannot serve directory /srv/www: No matching DirectoryIndex (index.html) found, and server-generated directory index forbidden by Options directive.
Except that the Options directive allows auto-indexing! I've tried Options All. I've tried Options +Indexes +FollowSymLinks. I've looked at 7 or 8 Google hits. Nothing is working.
Setting LogLevel debug doesn't increase messaging.
What have I missed?
As noted here, in the absence of an index.html (or other configured index file), the welcome page configured at /etc/httpd/conf.d/welcome.conf will take precedence over other configurations via its LocationMatch directive. Rename the file so it doesn't end in .conf and auto-indexing works.
Obviously landing in another virtualhost or Directory without indexes enabled, or a .htaccess getting in the way.
Set "AllowOverride none" first, since it is absurd to have it active if you are not using any .htaccess file (and since you have access to the main server you don't need it). Once you set AllowOverride, restart the server in case you added Indexes recently and didn't restart to apply changes.
If the issue persists, run apachectl -S and make sure you are landing in the correct virtualhost.
I just want to add that, after updating my mac to Catalina, my apache stopped working with that same error.
I had to:
uncomment the required modules (php7, rewrite, directory, etc...)
add a + sign to the Options (Options +FollowSymLinks +Multiviews +Indexes)
This worked for me.
Solution:
Ensure two apache modules are running:
mod_autoindex.so
mod_dir.so
In your case, mod_autoindex.so is running. Now enable the second one.
PS: Keep Options -Indexes. It's important. It makes sure that directory listings are disabled, as you shouldn't allow anyone to pay a visit to every directory on your server (some with rather private content such as CMS's directories).
I've already enabled mod-rewrite with
sudo a2enmod rewrite
I've added my Drupal7 install to the apache config file located in /etc/apache2/sites-available/default (note: Is this the correct config file to edit?)
<Directory "/var/www/myDrupal">
AllowOverride All
Order allow,deny
Allow from all
</Directory>
Then I restarted Apache2 with
sudo /etc/init.d/apache2 restart
Yet it still fails the Clean URL test in Drupal. I've been banging my head against the keyboard for far too long. Anyone have any other suggestions?
If you have it residing in a "myDrupal" folder off the root, then it is in a sub directory. You need to edit .htaccess, and uncomment "RewriteBase /" on line 110.
Just change
# RewriteBase /
to
RewriteBase
Then Flush your Drupal Cache and try again.
If your .htaccess looks good, and the apache config file is set correctly with AllowOverride All, try navigating to clean-urls configuration page by yourSite.com/admin/config/search/clean-urls and enable it! Clean URL's test sometimes fails even though your server is properly configured to rewrite.
Good luck!
You need to enable mod_rewrite. You'll have to cause the following to happen during instance createion:
a2enmod rewrite
service apache2 restart
Enabling clean urls for Ubuntu 14.04
(1) Run the command a2enmod rewrite on your ubuntu (Command Line Interface) CLI to make sure rewrites are installed.
(2) vi /etc/apache2/apache2.conf
a. Under all the AllowOverride All
(3) In the .htaccess file under /var/www/ if that is your place of drupal installation make sure the Rewritebase / is uncommented and correct. If your drupal installation is **Rewritebase /var/www/drupa**l, then change it to that.
(4) Run command service apache2 restart on your ubuntu CLI and you should be good.
* Optional - make sure your root
~Good Luck
I've got Apache 2.2 installed on my Windows machine, and there seems to be a problem with .htaccess.
I enabled `mod_rewrite` in `httpd.conf` file, and wrote some conditions into my .htaccess, but nothing works. I tried putting some garbage into it, to see if it would return Internal Server Error, but not even that would work. What could be the problem?
Could the problem be, that my Apache is located in "C:\Program Files\Apache Software Foundation", and my server root is at "C:\Users\Grega\Server"? I can't find anything that would point to .htaccess in httpd.conf
Make sure you don't have AllowOverride None set for the directory C:\Users\Grega\Server. Otherwise htaccess files could be entirely ignored. You could turn all the overrides on by an AllowOverride All or at the very least AllowOverride FileInfo.
Make sure you don't have AllowOverride None set for the directory C:\Users\Grega\Server. Otherwise htaccess files could be entirely ignored. You could turn all the overrides on by an AllowOverride All or at the very least AllowOverride FileInfo.
Jon Lin
For me this didn't work. But i found a solution. Go to \wamp\bin\apache\apache2.4.9\conf\httpd.conf and find
<IfModule dir_module>
DirectoryIndex first_page.html if_not_found.html
</IfModule>`
Change first_page.html to anything you want.
(I'm not native english speaker, so I apologize for my bad english.)
I have a Debian web-server with Apache2 installed and need to set in one directory DirectoryIndex to .html file (exactly this name - .html). But when I try to open page from browser it send 403 error.
I've changed apache2.conf (set to allow .ht files), I placed .htacess file in directory and set in it:
DirectoryIndex .html index.php index.html
AllowOverride All
Order Deny,Allow
Allow from all
But it still not work and displays 403 error. What i doing wrong and what i forget to do?
The correct answer is:
<FilesMatch "^\.html">
Order deny,allow
</FilesMatch>
DirectoryIndex .html
Sounds like you have a rule somewhere in your apache file that denys access to files starting with a .. This is generally a Good Thing, as a lot of sensitive files start with dots (ie: .htaccess, .svn, .git, .htpasswd, etc etc).
You might be able to get around the issue with something like this:
<FilesMatch "^\.html">
Order allow,deny
Allow from all
</Files>
Disclaimer: This seems like a hack. I don't know what you're trying to do, but there's probably a cleaner, less error prone way to do it.
I've just set up a new Ubuntu 10.4 slice on Slicehost, and have installed apache, mysql and php. I've uploaded my CakePHP app and everything is running fine, except for the webroot being inaccessible. I have tried adding AllowOverride to all in /etc/apache2/sites-available/default and followed the Cake instructions to httpd.conf by adding
<Directory />
Options FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all</Directory>
However, this is still not redirecting properly. I've hacked the css script tags to point to /app/webroot/css but would really like to know how to solve this issue properly. Any help would be much appreciated, this is the first time for me to setup a new slice, so apologies for the noobish question
For me this sounds like mod_rewrite problem. Could you check if you enabled your mod_rewrite in apache configuration?