I am facing a very common issue here hoping someone have the same experience could help me.
The issue is quite normal. I could find plenty issue posts and solutions by search google.
For example:
http://wordpress.org/support/topic/wordpress-permalink-404-issue
But the weird thing is after I delete # from
#LoadModule rewrite_module modules/mod_rewrite.so
and also did this part:
I opened up the httpd.conf file and found:
<Directory />
Options FollowSymLinks
AllowOverride none
Order deny,allow
Deny from all
</Directory>
and changed the AllowOverride none to AllowOverride all.
Now it's looking like this:
<Directory />
Options FollowSymLinks
AllowOverride All
</Directory>
but it's still not working.
I'm using WAMP for my localhost and the website works well when I change permalink setting back to default (with post ID).
Here is the .htaccess code I'm using.
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /dev/mysite/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /dev/mysite/index.php [L]
</IfModule>
# END WordPress
Did I miss something? Really need your help! Thanks in advance.
I Got Answer. It's easy only.
1) Go to WAMP logo in right-bottom of Task-bar of Windows.
2) Click left button
3) then Apache -> Apache Modules
4) Tic(select) the rewrite_module
5) that's all.
For More
1) Go to WAMP logo in right-bottom of Task-bar of Windows.
2) Click left button
3) then Apache -> Apache Modules
4) Tic(select) the rewrite_module
5) that's all.
THIS WORKS, THANKS A MILLION.
I spent hours trying to solve this problem, f* ridiculous!
I'm just learning to use wordpress and got completely stuck with a simple thing like adding a page, complete waste of time. Almost decided to use joomla....
Related
Trying to fix this .htaccess, so it can work on a SSL apache server. Before it was hosted on another Linux server (http://) and was working without problems, but when uploading the files to another Linux server with apache and SSL (https://), it stopped working. The main function is to hide the .php extension...
HereĀ“s what I was using:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
# To externally redirect /dir/foo.php to /dir/foo
RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s([^.]+)\.php [NC]
RewriteRule ^ %1 [R,L,NC]
## To internally redirect /dir/foo to /dir/foo.php
RewriteCond %{REQUEST_FILENAME}.php -f [NC]
RewriteRule ^ %{REQUEST_URI}.php [L]
Thanks for your help!
So, .htaccess files may not be allowed, and by default on many systems they are not allowed. To see if .htaccess is allowed, make this your .htaccess:
BREAK IT!
That should be the only contents in your .htaccess. Attempt to load any page on your website, and if .htaccess usage is enabled, you would see "Internal Server Error" or possibly some other error, but you would not see your actual page.
If you do see the error, that's actually good and means .htaccess usage is enabled. If you don't see the error, it's likely that you will have to find your Apache .conf file and inside look for the line(s):
AllowOverride None
Change that to:
AllowOverride All
If after doing that you still can't use .htaccess, then there may be other apache related files that have "AllowOverride None". On that comes to mind is your virtual host file, and on my system that is located at /etc/apache2/sites-available/.
If you still have problems, check this out:
https://docs.bolt.cm/3.3/howto/making-sure-htaccess-works
Solution is for the issue, need to change in apache2.conf file after that it will works,
Change this file /etc/apache2/apache2.conf
update it same
OLD:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride None
Require all granted
</Directory>
New Updated Code:
<Directory /var/www/>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
I had a similar problem. Apache 2.4.23 with .htaccess error 404 set up.
Using it with HTTP works fine; access it with HTTPS didn't work.
I seted AllowOverride All in the http.conf and error 404 wors well.
I have a few platforms (domain.com/omeka, domain.com/wordpress, domain.com/omeka-s) living alongside each other on an Azure cloud server running Ubuntu 14.04.4 and Apache 2.4. A few days ago, I tried installing an additional platform, but doing so seemed to break everything else on the server, so I removed it and reinstalled Apache. After editing the .htaccess file to remove a typo, everything worked. I left for the weekend, came back to work this morning, and everything is broken again.
By broken, I mean every URL on the server redirects to a mod_rewrite installation error page for Omeka (domain.com/install). Omeka has already been installed and running for months. MR needs to be enabled for Omeka to be installed and function properly. MR is definitely enabled.
$ sudo a2enmod rewrite
Module rewrite already enabled
I'm assuming this is a problem with either the /var/www/.htaccess file or the /etc/apache2/apache2.conf file. Here's the relevant .htaccess code that is default for Omeka:
RewriteEngine on
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule !\.php$ - [C]
RewriteRule .* - [L]
RewriteRule ^install/.*$ install/install.php [L]
RewriteRule ^admin/.*$ admin/index.php [L]
RewriteRule .* index.php
And here's the relevant(?) apache2.conf code:
<Directory />
Options FollowSymLinks
AllowOverride All
Require all denied
</Directory>
<Directory /usr/share>
AllowOverride None
Require all granted
</Directory>
<Directory /var/www/>
Options Indexes FollowSymLinks MultiViews
AllowOverride All
Require all granted
</Directory>
AccessFileName .htaccess
If I remove the .htaccess file, or if I just remove some of RewriteRules, everything on the server is inaccessible (including Wordpress & Omeka-S). I'm clearly missing something. Any ideas?
Figured out the problem. Very simple, stupid stuff.
Problem 1: When I reinstalled Apache, the /etc/apache2/sites-available/000-default.conf file reverted the DocumentRoot to /var/www, when it was supposed to be /var/www/html.
Problem 2: There was an additional and nearly identical .htaccess file in /var/www/html/omeka that had a typo. It was missing the ^ before install/.*$
Also, the IT department who set up the cloud server for me installed 2 instances of Omeka (who knows why), one under /var/www and one under /var/www/html, so this whole problem most likely would have been averted (or at least easier to solve) if that wasn't the case.
I know there are a million of questions about this, but I've tried the solutions in other questions and haven't got it to work in my case. I'm trying to redirect everything to index.php:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^ index.php [L]
</IfModule>
This works in my local environment, but in my staging environment it fails and I get a 404 error. I've checked that mod_rewrite is enabled with phpinfo(). I've tried changing a few things like using ^(.*)$ instead of ^ and using /index.php instead of index.php
What else could be the problem?
Figured it out. It was a problem with the configuration of apache. Whoever set it up for the site I'm working on did it like this in the site's .conf file:
<Directory "/data/path/to/directory">
Options FollowSymLinks
AllowOverride None
Order allow,deny
Allow from all
# and a bunch of rewrite rules...
</Directory>
The AllowOverride None prohibits the use of .htaccess. In our local and development environments, the directory structure is different, so this code doesn't even get applied. That's why the .htaccess was working.
To solve the problem I'll either have to change the line mentioned above to AllowOverride All or add another configuration for the website I'm working on like the one above that does what I wanted to do with .htaccess.
Problems like this shouldn't come up for anyone if their environments are configured appropriately, but if anyone does run into a similar situation, check the configuration of the site in apache!
Alright, I'm just trying to setup a simple rewrite rule for a site.
First off, in httpd.conf I have
LoadModule rewrite_module modules/mod_rewrite.so
Then in a seperate file I have this alias setup
Alias /vworker/ "f:/vWorker/"
<Directory "f:/vWorker/">
Options Indexes FollowSymLinks MultiViews
AllowOverride all
Order allow,deny
Allow from all
</Directory>
Alright now, so the directory of the site is
f:/vWorker/urlmask
In there I have an .htaccess file that says this
RewriteEngine on
RewriteRule ^redirect/([0-9]+)/?$ index.php?redirect=$1 [L]
Now, what I want, is if I go to the url http://localhost/vworker/urlmask/redirect/3161513 it will actually call http://localhost/vworker/urlmask/index.php?redirect?3161513
From my point of view everything seems to be set up right, and if I put gibberish in my .htaccess file I get a server error, so I know it's reading it.
What I end up with is a page that says "Not Found. The requested URL /vworker/urlmask/redirect/94173336828903446 was not found on this server."
Any ideas what I'm doing wrong?
In general, whenever you've got an Alias, you're going to need a RewriteBase to make things work as expected.
In your case, you should have
RewriteBase /vworker/urlmask/
in the same .htaccess as your rules.
I am not able to switch to pretty permalinks in WAMP. Changing to any form other than default gives 404 error.
I have switched on the rewrite_module in Apache. I Googled the problem and found that following changes should be made to httpd.conf file. My httpd.conf file stands as
<Directory />
Options Indexes FollowSymLinks
AllowOverride All
Order deny,allow
Deny from all
</Directory>
I also checked that the .htaccess file is getting created. It reads as
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /vit%20web/events/
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /vit%20web/events/index.php [L]
</IfModule>
# END WordPress
All you need to do is turn on the mod_rewrite in the wamp settings tab.
Click Wamp -> Apache -> Apache Modules -> rewrite_module
If you select that then turn on %postname% it should work
Did you reboot Apache after editing httpd.conf?
A bulletproof check for mod_rewrite is to remove the <IfModule>...</IfModule> tags and try running WordPress - if you get a 500 Server Error, mod_rewrite isn't installed.
Also I would recommend changing <Directory /> to <Directory "C:/path/to/server/root"> (note the forward slashes too, even on Windows).
And the deny order should be switched if you're only on a development server;
Order allow,deny
Allow from all
The problem may be:
Whenever you have permalinks in subfolder of your main www folder (i.e.
RewriteBase /subdirectory/
you may need to have a .htaccess file in your main c:\wamp\www folder too.