Forum Moderators: phranque
WP won't touch the htaccess as long as its Standard code is not touched
put yours before WordPress's
<Files "xmlrpc.php">
Order allow,deny
Deny from all
</Files>
<Files "xmlrpc.php">
Order allow,deny
Deny from all
</Files>
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
whatever
</IfModule>
# END WordPress I have seen it malfunction if you remove that wrapper
RewriteBlahblah #internal .html-rewrite
RewriteRule ^((onedir|otherdir|thirdddir)/\w+)\.html /index.php?$1 [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
# disabling xmlrpc.php
<Files "xmlrpc.php">
Order allow,deny
Deny from all
</Files>
(onedir|otherdir|thirdddir) xmlrpc.php is needed for remote working and pingbacks.
# Protect wp-login
<Files wp-login.php>
AuthUserFile ~/.htpasswd
AuthName “Private access”
AuthType Basic
require user mysecretuser
</Files>
# disabling xmlrpc.php
<Files "xmlrpc.php">
Order allow,deny
Deny from all
</Files>
# Protect wp-login
<Files wp-login.php>
AuthUserFile ~/.htpasswd
AuthName “Private access”
AuthType Basic
require user mysecretuser
</Files>
#internal .html-rewrite
RewriteRule ^((onedir|otherdir|thirdddir)/\w+)\.html /index.php?$1 [L]
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Here are the details
it shouldn't block any necessary subrequests.
This means, that in future all web user will visit my pages only with URLs like site.com/page1 (without .html - unlike now), due to this rewrite. Right?
wouldn't it just use whatever form of the URL you're telling it to link to?Yes, or course, if the link is in the content, it will be in every version of the content in that same form that you wrote it as. I was talking about the internal URL structure that WP generates.
RewriteRule ^((dir1|dir2|dir3)/\w+)\.html http://www.example.com/$1 [R=301,L] ^((?:dir1|dir2|dir3)/\w+|page1|page2|page3)\.html