New answers tagged

0

Are you running your site on cPanel? If so, explore your control panel and you'll see a few great modules. hotlink protection leech protection Under Advanced tab, look for indexes. Once you click you can customize and "hide non public" resources very easily.


1

No, you'd want a rewrite rule that captures & redirects the request: RewriteEngine On RewriteBase / RewriteRule ^(.*)$ http://example.com/$1 [R=301,L]


0

Don't touch the .htaccess file, there's this neat tool add_rewrite_rule() which you should hook into init: add_action('init', function() { add_rewrite_rule( 'search+([^/]+).html$', 'index.php?my_custom_search=1&s=$matches[1]&submit=Search', 'top' ); }); Right after that you should flush the rewrite rules once ( by ...


1

There is actually nothing unique about setting multisite on XAMPP, all you need to do is properly configure the webserver as a proper webserver, and skip the lazy practice of using localhost as your site domain. Select some random domain you are not likely to use in your web use, edit your hosts file to point that domain to 127.0.0.1, and set the vhost in ...


0

You should never set an expiry for the HTML which is longer then few hours and never set expiry for logged in users at all. The reason is that while you can cache bust CSS, JS and even images, you just can't do it with HTML as users are accessing html URLs directly and you have no way to instruct them to go to a "fresher" ones. In you case ExpiresDefault ...


3

Unsurprisingly so since you tell browser to cache everything for 1 month by default (ExpiresDefault "access plus 1 month"). You should limit long caching times to static resources and leave pages served by WP out of it. My go to resource for .htaccess configuration is HTML5 Boilerplate. It works with WP nicely and correctly excludes web pages from ...


3

What causes /pages/ to appear in URI? As it turned out, you had a parent page with slug pages. How to remove it? Don't have a parent page. is there an easy way to prevent child pages from showing the parent page in the URI? This has been asked and answered countless times, for example here, you can find more here. Im not going to duplicate ...


0

You could just set custom permalinks for your categories with this plugin.


2

For the sake of clarity, this should be your .htaccess RewriteEngine On RewriteBase /zingery/wordpress/ RewriteRule ^index\.php$ - [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /zingery/wordpress/index.php [L]


1

Problems I get too many redirect: all urls redirect infinitely to themselves, why? Apache rewrite rules are processed top-to-bottom, so your custom rewrite rule is always processed first. The R redirect flag instructs Apache to tell the browser to make a new request to the altered URL instead of serving the destination of the rewrite at the current ...


0

Please try <IfModule mod_rewrite.c> RewriteRule ^/privacy-policy/? privacy-policy [L,NC] RewriteCond %{HTTP_HOST} ^(www\.)?oldsite\.com [NC] RewriteRule ^ http://mywebsite.com%{REQUEST_URI} [NE,R=301,L] </IfModule>



Top 50 recent answers are included