How to create short urls for sharing and downloadable content?

Here’s a possibly simple solution, using an ancillary table, and user-defined short slugs: create a post_meta “short_slug” when creating a post, the link-name from your example on save_post, if (meta_key=’short_slug’ and is_a_valid(meta_value)) wpdb->insert into short_slugs_table slug,permalink , your index.php on your mgscr.com could then open a mysql connection to the same db, parse the url … Read more

Why is a custom post type’s URL “/?cposts=name-of-the-post” but default post’s URL is “/?p=ID”?

For normal posts you can set the permalink structure on Settings → Permalinks. All details can be found in the Codex For custom post types you can set the slug when you registering it: add_action( ‘init’, ‘create_posttype’ ); function create_posttype() { register_post_type( ‘cpost’, array( ‘labels’ => array( ‘name’ => __( ‘cpost’ ), ‘singular_name’ => __( … Read more

How to retrive previous Domain URL in Wp

If you have access to the wp-config.php on the server, you can add the following constants that will override the database. This does not save the settings but will at least get you viewing the site again. define( ‘WP_SITEURL’, ‘url_to_wordpress_core_files’ ); define( ‘WP_HOME’, ‘url_to_wordpress_front_end’ ); There is also a RELOCATE constant that will make the … Read more

URL RewriteRule doesn’t work when using WP Database Participants in my WordPress website

I’d try changing the order of your rules. Once the default WP rules run, your URL will be rewritten and your last rule won’t work. SetEnv no-gzip dont-vary RewriteEngine On RewriteRule ^produse/piese-schimb-utilaje-agricole/([0-9]+)/?$ ^produse/piese-schimb-utilaje-agricole/?listpage=$1&search_field=none&value=&operator=LIKE&sortBy=denumire&ascdesc=asc&submit=&sortstring=denumire&orderstring=asc#participants-list [NC,L] # Turn mod_rewrite on RewriteEngine On RewriteBase / RewriteRule ^index\.php$ – [L] # add a trailing slash to /wp-admin RewriteRule ^([_0-9a-zA-Z-]+/)?wp-admin$ … Read more