How to redirect multiple subfolders back to root domain?

This is the solution I finally found after many hours investigation: RewriteRule ^subfolder1/(.*)$ http://www.domain.tld [R=301,NC,L] With the above code in the .htaccess-file, which is located in your websites root directory, all URLs which contain www.domain.tld/subfolder1/* are redirected to the root domain. Hope this will help anybody else than me 🙂

Cannot access subdirectory subpages

Finally fixed this errow after browsing for a couple of hours and trying many options. In this block in your Apache httpd.conf file, (located in my CentOS instance at $ sudo vi /etc/httpd/conf/httpd.conf) # # AllowOverride controls what directives may be placed in .htaccess files. # It can be “All”, “None”, or any combination of … Read more

Custom permalink structure only saves with index.php inserted

When you include index.php/ at the start of your custom permalink structure you are telling WordPress to use PATHINFO permalinks. WordPress Codex – PATHINFO: “Almost_Pretty” It is possible you are using an IIS (Windows) server or that mod_rewrite is not working correctly. Permalinks without mod_rewrite The following plugin can help you determine if mod_rewrite is … Read more

How do I reset a rewrite?

.htaccess rules are interpreted and applied on every request, they don’t linger on server level and changes apply immediately. However if you had had 301 redirect set up then it can be cached by browser very aggressively. I do not observe redirect you are describing, so that is likely the case. Note that your home … Read more

Change root directory

Why do you want to use .htaccess to do this? Why not just move to the new URL? Alternatives include adding something similar to one of the following to your .htaccess file (note the 301 “permanently moved” code being sent back to the browser in both cases): RedirectMatch 301 /e /wp or <IfModule mod_rewrite.c> RewriteEngine … Read more

WordPress permalinks confusion

It is the way the .htaccess wordpress generatea instructs apache to work on the wordpress directories The relevant parts from the default .htaccess RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] The first line will cause the rewrite engine to bail out if there is a file with the same name as the … Read more