Nginx WordPress and another Web app URL structure
You should try the Rewrite plugin as mentioned in this post “Nginx rewrite rule conflict with WordPress permalinks rule“, it could help solve the issue. If not, we’ll have to dig deeper, let me know.
You should try the Rewrite plugin as mentioned in this post “Nginx rewrite rule conflict with WordPress permalinks rule“, it could help solve the issue. If not, we’ll have to dig deeper, let me know.
<?php $string = ‘Sentence 1. Sentence 2? Sentence 3! Sentence 4… Sentence 5… Sentence 6! Sentence 7. Sentence 8. Sentence 9… Sentence 10… Sentence 11. ‘; $sentences_per_paragraph = 3; // settings $pattern = ‘~(?<=[.?!…])\s+~’; // some punctuation and trailing space(s) $sentences_array = preg_split($pattern, $string, -1, PREG_SPLIT_NO_EMPTY); // get sentences into array $sentences_count = count($sentences_array); // … Read more
You can only have one page at example.com so let’s say you have an ‘about’ page: example.com/about In WordPress Settings > Reading Settings you can select a static page to be the homepage, so example.com would now show the ‘about’ page. Now, go to WordPress Settings > Permalinks and select Post name.
If the links are coming from the main content areas, you could create a hook which acts against this “content” output. In your themes functions.php file, you could try something like: add_filter(‘the_content’, ‘the_url_filter_function_name’, 30); function the_url_filter_function_name($content) { return str_replace(‘bad-url.com’, ‘good-url.com’, $content); } If the URLs you are looking to modify are being stored and output’d … Read more
You can’t do this by default, but you can write a query to do it within your theme. It could be a security risk to allow any field to be entered in the URL, so you’ll need to explicitly detect those that you are wanting. In your functions.php, you could add something like this (untested!): … Read more
You need to update all the places in the database that are using the original location. you can use the following tool to do so. There are others but I have found this one to be easy. Just remember to remove the files after you are done with it. I would run this in it’s … Read more
It is possible to add a filter to the_content that takes the query_var (in this case ‘uuid=237237’) from the url and appends it to any outgoing links. But that is beside the point. Because if the link leads to a place outside the current WordPress install the query_var will be lost anyway, even if the … Read more
When someone messes up an URL it’s typically not something to do anything about. If you look at any site’s log they receive tons of completely broken and malformed requests every day. You only have to care about one case — that URL parses properly and input data is valid and safe. Whenever request is … Read more
In WordPress attachments are treated as posts, with their own titles, excerpts and metavalues. So if a post has an attachment there are two sets of metavalues, one for the post itself and one for the attachment. You are using update_post_meta( $post[‘ID’] … to store the url. So it is stored as a metavalue of … Read more
Step 1: Create a page with slug ‘profile’ in your WordPress Dashboard. Step 2 Use this function to register profileId var. add_filter(‘query_vars’, ‘wp233_query_vars’); function wp233_query_vars( $query_vars ){ $query_vars[] = ‘profileId’; return $query_vars; } And add a rewrite rule to wordpress like this: add_action( ‘init’, ‘wp233_add_rewrite_rules’ ); function wp233_add_rewrite_rules() { add_rewrite_rule( ‘^profile/([^/]+)?$’, ‘index.php?pagename=profile&profileId=$matches[1]’, ‘top’); } Step … Read more