Adding rewrite rules directly to .htaccess file

As it says in the file:

The directives (lines) between “BEGIN WordPress” and “END WordPress” are
dynamically generated, and should only be modified via WordPress filters.
Any changes to the directives between these markers will be overwritten.

Put your code before #BEGIN WordPress or after # END WordPress.

However, in the [L] flag means LAST, so no more rules will be run if that one has a hit.

So this rule will need to be above the # BEGIN WordPress

Try this .htaccess:


# Just to be safe, wrap it in IfModule mod_rewrite.c, so that 
# it does not kick in unless mod rewrite is enabled.
<IfModule mod_rewrite.c>
RewriteRule ^apply\/? https://docs.google.com/forms/d/e/1FAIpQLSf5IrOhg0E_NAGZnOvMuaXhU80sio8bukaWVBkb87eEOa9kTw/viewform [L]
</IfModule>

# BEGIN WordPress
# The directives (lines) between "BEGIN WordPress" and "END WordPress" are
# dynamically generated, and should only be modified via WordPress filters.
# Any changes to the directives between these markers will be overwritten.
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

There is a great tool to debug your .htaccess file, it’s called htaccess tester. I prepared two examples:

🛑 Why it won’t work when your rule is in below the line containing RewriteRule . /index.php.
✅ The fully working example I posted above.