Answer the question
In order to leave comments, you need to log in
How to add a script to WordPress exclusions?
There is a script processing zip-files. You want it to run on a request like:
zip-file/filename/27
$path=$_SERVER['REQUEST_URI'];
$zippPath = parse_url($path, PHP_URL_PATH);
$zippPath = substr($zippPath, 1);
list($zippPathCheker, $zippPathName, $zippPathNum) = preg_split('[/]', $zippPath);
if($zippPathCheker == 'zip-file' && is_numeric($zippPathNum)){
include_once (plugin_dir_path( __FILE__ ).'/pl_zip.php');
}
Answer the question
In order to leave comments, you need to log in
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_URI} !^zip-file/ #here your URI and '!' is required...
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>
# END WordPress
Create a zip
folder in the root of WP . This is where you put your php script. In the same zip folder you create a .htaccess file with the content
Then you access the script itself as wp-example-site.org/zip/zip-file/filename/27
Of course, as a plugin, you will no longer see it in WP, so some settings from it, if you need them, will have to be pulled by hand.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question