New answers tagged

1

You've put your "redirect" directives in the wrong place - they need to go at the top of the file, before the # BEGIN WordPress section. By placing them later in the file (after the WP front-controller) then they are only going to get processed for requests that map directly to physical files and directories (which includes the document root). So, ...


0

This does redirect: RewriteCond "www.%{ENV:DOMAIN_NAME}" "!=%{HTTP_HOST}" Because server variables of the form %{VARNAME} are not expanded in the CondPattern (2nd argument to the RewriteCond directive). You are comparing against the literal string "%{HTTP_HOST}", which is obviously different to "www.localhost.com", so ...


2

This is technically possible, however, there is another "preferred" solution for "a CMS with a public folder and a private folder" (see below). To summarise the requirements: Allow requests for /private/ or /private/<something> (where <something> is not a physical file in the /private subdirectory) to be routable through the ...


1

I played around with this a bit, and I don't believe it is possible - at least not in the main .htaccess file without messing with server limits. I posit it may be possible to override the default behaviour by modifying the apache configuration file. It might make sense to move your private configuration above your document root (I assume you are using it to ...


3

Just a few notes regarding your existing directives: RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME} !-l RewriteRule ^pdfs/([^/]*)/([^/]*)/([^/]*)/([^/]*)$ /pdftools/openpdf.php?file=$1&task=$2&dsp=$3&id=$4 [L] RewriteRule ^pdfs/([^/]*)/([^/]*)/([^/]*)$ /pdftools/openpdf.php?file=$1&task=$2&dsp=$3 [L] RewriteRule ^...


Top 50 recent answers are included