My custom .htaccess commands are above the WP ones. This is working:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ wp-content/ahoj.txt [N]
</IfModule>
It shows the contents of my file ahoj.txt at the root of example.com
While this isn't working:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteRule ^$ language/ [N]
</IfModule>
As language/ is not a real directory, but a permalink set by wp (wpml). How do I make the contents of example.com/language
visible at example.com
without changing the URL?
.htaccess
. When you internally rewrite the request (in htaccess), WP still "sees" the URL that was requested (ie. the root), not the URL that is rewritten to (ie./language
). And you should be using theL
flag, notN
! (No need to repeat the<IfModule>
andRewriteEngine
directives.)add_rewrite_rule()
? I couldn't get that work either...