CDN + WP Admin Query – .htaccess redirection

Say I have a website at https://www.example.com and I am using a CDN. Now if I want the CDN URL to be https://www.example.com/assets/… and not https://assets.example.com, then what should I do? Is it a good idea to create a redirection where the wp-admin will always get files from example.com and not www.example.com? www.example.com is pointed … Read more

Removing code added to htaccess with insert_with_markers

I use insert_with_markers in a couple of my plugins to add some small bits of code to the htaccess file. What I’m unclear about is how to remove the code and markers. For example, if I call the function like this:- insert_with_markers($htaccess, “marker”,”RewriteBase /foobar”); The result in htaccess is:- # BEGIN marker RewriteBase /foobar # … Read more

Passing parameters to WordPress static front page

I have a custom plugin that shows a series of custom posts on a page, i.e. http://www.example.com/permalink/ On that page I have a form to filter the posts according to a number of different parameters, and it is passed as: http://www.example.com/permalink/?param1=1&param2=2&param3=3&param4=4&pagi_page=1 The problem: If I change that page to be the static front page, the … Read more

some url does not redirect from http to https

I am trying to solve my https redirection from all away.I follow the all solutions form stackexchange. But still in problem so I am writing here. Problem is that https redirection is working but some url not redirect. For example . http://example.com/contact not redirect on http://example.com/contact. This is my code . define( ‘WP_CACHE’, false ); … Read more

WordPress multisite htaccess redirection to new domain

RewriteCond %{HTTP_HOST} ^site.olddomain.com$ [OR] RewriteCond %{HTTP_HOST} ^www\.site.olddomain\.com$ RewriteRule ^(.*)$ https://site.newdomain.com/$1 [R=301,L] All posts URLs are redirecting successfully. But the problem is my old multisite site_id is different from the new multisite site_id. So all site.olddomain.com/wp-content/uploads/sites/7/.. is redirecting to site.newdomain.com/wp-content/uploads/7/… But the site_id at the new domain is 2, not 7. I tried this RewriteCond %{HTTP_HOST} … Read more

Alias ‘wp-content’ directory to something shorter (framework?)

I recall seeing this as a feature of a WordPress Development Framework, so I know it’s possible (can’t remember the framework). I am interested in how to condense the WordPress-generated urls to something more concise and not so “WordPressy”. I’m thinking that I would have to both update the .htaccess and add some kind of … Read more

Cannot mask WordPress page URL using .htaccess

.htaccess: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wp_test/ RewriteRule ^index\.php$ – [L] RewriteRule ^the_image$ wp-content/uploads/2019/01/banner\.jpg [L] RewriteRule ^the_page$ sample-page [L] </IfModule> When I go to example.com/the_image it shows the correct image. However, if I go to example.com/the_page it shows the page not found page. Any work around on this? 3 Answers 3 Please make sure your … Read more

Redirect from different port to subdomain – htaccess

I created a Digital Ocean instance to install WordPress website 5 days ago. I already have my own domain, and created DNS Subdomain blog.example.com. The server runs both nginx and apache so my Apache port is 8082. Below is what my actual WordPress URL looks like: www.example.com:8082/wordpress/ Something which I have tried is below. <IfModule … Read more