Use Regex Redirection via htsaccess for RSS Feeds WordPress
Use Regex Redirection via htsaccess for RSS Feeds WordPress
Use Regex Redirection via htsaccess for RSS Feeds WordPress
No need for a Regex. There’s substr( $string, int $offset ); built into PHP to achieve that.
You should probably use something like regex101.com to test this before you run it on a database. You could start off with something like: wp search-replace ‘<iframe ((width|height|frameborder)=”\d+” |allowfullscreen)+?src=”https://wordpress.stackexchange.com/questions/222382/https?:\/\/www\.youtube\.com\/embed\/([a-zA-Z0-9]+?)” ((width|height|frameborder)=”\d+” |allowfullscreen)+?>\<\/iframe\>’ ‘https://www.youtu.be/$1′ –regex but I’m not 100% sure of that…
First: You return before you add the values to the $outvalue, so this part of the code is never reached. Second: You have typos, when adding the values to $outvalue. This function works for me: function myVal($attr, $content = null) { extract(shortcode_atts(array( ‘var1’ => ”, ‘var2’ => ”, ‘var3’ => ”, ‘var4’ => ”, ‘var5’ …
Regexes allow only [a-z][A-Z][0-9] and –
Remove Custom HTML Posts Using Regex
Restrict comments with regular expression
You should try changing your WordPress Site URL from Non WWW to WWW (Eg. if your site url is http://example.com then you should edit it from Setting > General > WordPress URL to http://www.example.com I think this will solve your problem.
It’s nice to use regex, but you can also achieve the same thing here by just splitting the string on ‘:’ with explode e.g.: $matches = explode(“:”, get_the_title()) ; if (count($matches) == 2) { $result = “foo bar $matches[0] foo bar $matches[1]”; } else { // case with no : in title $result = “foo …
Add the following to your .htaccess, in between the <IfModule mod_rewrite.c>: RewriteCond %{HTTP_HOST} !^(.*)/page/$ RewriteRule ^(.*)$ /category/$1/? [R=301,L] Your default .htaccess created from WordPress should now look like the following: # BEGIN WordPress <IfModule mod_rewrite.c> RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule . /index.php [L] # Custom …