WordPress不使用.htaccess

Have been around the houses with this - have read many htaccess issues etc - and still can't seem to get this to work.

I have a WordPress site installed at var/www

I wanted to have a specific URL point to a specific page. Started by browsing some WordPress plugins. None of them worked so I just went straight to the source and started editing the .htaccess file in the root of the WordPress installation. This is where it started getting frustrating.

One of the many attempts at an .htaccess file:

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
Options +FollowSymLinks
Redirect 301 /redirect-me http://my-wordpress-site/?page_id=15
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress

All attempts at a Redirect have resulted in 404 Not Found errors.

I have asserted the following things:

  • Apache2 Rewrite Module is enabled
  • www-data has both read and write access to the .htaccess file.
  • AllowOverride is set to All in the apache2.conf file for the directory

Here's a big clue for you: swapping the last ReWrite rule within my .htaccess file does absolutely nothing to my WordPress site...

RewriteRule . /poo.php [L]

Any other suggestions for debugging a failing .htaccess file?

When you make configuration changes such as AllowOverride in the config, make sure your do a restart on Apache2 so the changes become effective. Give that a shot.