Skip to main content
Highlighted download URL of plugin
Source Link

I have embedded the accepted answer by @shea in a one-file plugin, and added two options: redirect only non-admin users & redirect to an arbitrary URL.

If interested, please feel free to download the plugin from Github => https://github.com/Idearia/wp-redirect-website-to-url.

Options

The plugin options are very simple; for the time being, they are hard-coded in the plugin file, but I might consider building an option page if people request it:

  • DESTINATION_URL: The full URL where to redirect users; can be a page outside the website domain.
  • DESTINATION_URL_ID: If the redirection URL is a WordPress page or post, specify here its WordPress ID.
  • USER_CAPABILITY: Users with this capability won't be redirected; leave blank to redirect everybody; default is 'manage_options' which is enabled for admin users.
  • REDIRECT_STATUS_CODE: Redirection status: 302 for temporary redirect, 301 for permanent redirect.
  • DEBUG: Whether to print debug information in debug.log.

Updated info on the Github page => https://github.com/Idearia/wp-redirect-website-to-url.

Please note that the plugin is very basic; more advanced users might consider instead one of the many maintenance plugins available on the WordPress.org plugin repository.

Let me know if you have any problem running the plugin 😊

I have embedded the accepted answer by @shea in a one-file plugin, and added two options: redirect only non-admin users & redirect to an arbitrary URL => https://github.com/Idearia/wp-redirect-website-to-url.

Options

The plugin options are very simple; for the time being, they are hard-coded in the plugin file, but I might consider building an option page if people request it:

  • DESTINATION_URL: The full URL where to redirect users; can be a page outside the website domain.
  • DESTINATION_URL_ID: If the redirection URL is a WordPress page or post, specify here its WordPress ID.
  • USER_CAPABILITY: Users with this capability won't be redirected; leave blank to redirect everybody; default is 'manage_options' which is enabled for admin users.
  • REDIRECT_STATUS_CODE: Redirection status: 302 for temporary redirect, 301 for permanent redirect.
  • DEBUG: Whether to print debug information in debug.log.

Updated info on the Github page => https://github.com/Idearia/wp-redirect-website-to-url.

Please note that the plugin is very basic; more advanced users might consider instead one of the many maintenance plugins available on the WordPress.org plugin repository.

Let me know if you have any problem running the plugin 😊

I have embedded the accepted answer by @shea in a one-file plugin, and added two options: redirect only non-admin users & redirect to an arbitrary URL.

If interested, please feel free to download the plugin from Github => https://github.com/Idearia/wp-redirect-website-to-url.

Options

The plugin options are very simple; for the time being, they are hard-coded in the plugin file, but I might consider building an option page if people request it:

  • DESTINATION_URL: The full URL where to redirect users; can be a page outside the website domain.
  • DESTINATION_URL_ID: If the redirection URL is a WordPress page or post, specify here its WordPress ID.
  • USER_CAPABILITY: Users with this capability won't be redirected; leave blank to redirect everybody; default is 'manage_options' which is enabled for admin users.
  • REDIRECT_STATUS_CODE: Redirection status: 302 for temporary redirect, 301 for permanent redirect.
  • DEBUG: Whether to print debug information in debug.log.

Updated info on the Github page => https://github.com/Idearia/wp-redirect-website-to-url.

Please note that the plugin is very basic; more advanced users might consider instead one of the many maintenance plugins available on the WordPress.org plugin repository.

Let me know if you have any problem running the plugin 😊

Source Link

I have embedded the accepted answer by @shea in a one-file plugin, and added two options: redirect only non-admin users & redirect to an arbitrary URL => https://github.com/Idearia/wp-redirect-website-to-url.

Options

The plugin options are very simple; for the time being, they are hard-coded in the plugin file, but I might consider building an option page if people request it:

  • DESTINATION_URL: The full URL where to redirect users; can be a page outside the website domain.
  • DESTINATION_URL_ID: If the redirection URL is a WordPress page or post, specify here its WordPress ID.
  • USER_CAPABILITY: Users with this capability won't be redirected; leave blank to redirect everybody; default is 'manage_options' which is enabled for admin users.
  • REDIRECT_STATUS_CODE: Redirection status: 302 for temporary redirect, 301 for permanent redirect.
  • DEBUG: Whether to print debug information in debug.log.

Updated info on the Github page => https://github.com/Idearia/wp-redirect-website-to-url.

Please note that the plugin is very basic; more advanced users might consider instead one of the many maintenance plugins available on the WordPress.org plugin repository.

Let me know if you have any problem running the plugin 😊