Search WordPress.org for: Submit Toggle Menu. Showcase; Themes; Plugins; Mobile; Support. Documentation; Get Involved. Five for the Future. Redirect agent; Some information is only visible by hovering over the row or by changing the display settings. Some information may not be available on older logs. Log entries can be deleted by clicking the delete link, by using the checkboxes and the Bulk Action dropdown, or by clicking the Delete All button at the bottom of the page.
I’ve previously written about the differences between 301 and 302 error pages and how to use them efficiently. In that, I’ve also talked about redirecting 404 pages using a basic plug-in. Blogtouch 1 3 0 – bloggerblogspot editor for your mac. However, if your goal is to try and minimize the number of additional plug-ins your site runs on, it’s not a great idea – especially considering how easy it is to simply write your own code.
So what’s the ideal way to handle a 404 error code? Personally, I would like the user to be redirected back to the homepage, though this is a matter of preference. Others might like to display the search page instead. Second, I’d like to get an email notification every time a “not found” status message is generated. Not just that, I want to know which URL generated the error in the first place so I can go back and correct it and perhaps even send a notification to the person hosting the original link to change the incorrect URL.
Using .htaccess
![Homemade Homemade](https://www.hostinger.com/tutorials/wp-content/uploads/sites/2/2019/09/locating-and-editing-htaccess-from-hpanel.png)
One way to redirect 404 pages is to handle them via .htaccess instead of PHP. This has the advantage of being a little more resource friendly on the server since it’s being handled right at the very top. In order to do this, simply add the following line to your .htaccess page:
“index.php” is the default WordPress page for most installations which will direct us to the homepage of the blog. While this accomplishes the redirect, it does nothing for our other requirements – namely sending an email along with the URL that was not found. Of course, we can always check our server logs periodically for 404 errors, but that’s not a scalable way of doing things.
Unless you get a huge number of “not found” errors every day, it’s best to opt for a PHP solution so you can take corrective measures. Not to mention you may not even have write permissions to .htaccess in the first place.
Redirecting 404 through PHP
To intercept 404 pages on your WordPress blog via PHP, simply open up your functions.php file located in your themes folder and paste in the following code before the closing PHP tag:
Shenzhen industrial font download free. Replace “[email protected]” above in bold with your own email ID. If you don’t know how to add custom code like this in WordPress, make sure to read my earlier tutorial on the same.
This makes use of the “template_redirect” action hook which fires just before WordPress decides which template to load. We simply intercept that, check for a 404 error message, send an email using the “wp_mail()” function and redirect back to the home URL.
If you want to change that to some other URL on your blog such as the search page for example, you need to include the relative path as a string inside, so you’ll probably have to use something like:
You can also break up the URL into its constituent parts and construct a search term to passed along as a parameter to your search page to automatically return possibly relevant results to your user. All these are great ways to handle 404 error messages in WordPress. As an example of the above code at work, here’s an email I received from my WordPress installation regarding a 404 error message along with the URL:
I’ve also included the referrer information so that if the visitor came via an external link, I can follow it back and perhaps even get in touch with the website administrator to make the correction. All of this without a plug-in and with just a few lines of code!
Related
![Made Made](https://3.bp.blogspot.com/-OmTjYeXQ8q0/XbhvDUxnexI/AAAAAAAAEcA/wNmmS3oubrE0uqD7KF8-EjUkISLMAa5rACLcBGAsYHQ/s1600/xxxx.png)
The following table includes the list of supported RDP file settings that you can use with the Remote Desktop clients. When configuring settings, check Client comparisons to see which redirections each client supports.
The table also highlights which settings are supported as custom properties with Windows Virtual Desktop. Rumpus pro 8 2 11 x 12. You can refer to this documentation detailing how to use PowerShell to customize RDP properties for Windows Virtual Desktop host pools.
Connection information
RDP setting | Description | Values | Default value | Windows Virtual Desktop support |
---|---|---|---|---|
full address:s:value | PC Name: This setting specifies the name or IP address of the remote computer that you want to connect to. This is the only required setting in an RDP file. | A valid name, IPv4 address, or IPv6 address. | No | |
alternate full address:s:value | Specifies an alternate name or IP address of the remote computer. | A valid name, IPv4 address, or IPv6 address. | No | |
username:s:value | Specifies the name of the user account that will be used to sign in to the remote computer. | Any valid username. | No | |
domain:s:value | Specifies the name of the domain in which the user account that will be used to sign in to the remote computer is located. | A valid domain name, such as 'CONTOSO'. | No | |
gatewayhostname:s:value | Specifies the RD Gateway host name. | A valid name, IPv4 address, or IPv6 address. | No | |
gatewaycredentialssource:i:value | Specifies the RD Gateway authentication method. | - 0: Ask for password (NTLM) - 1: Use smart card - 2: Use the credentials for the currently logged on user. - 3: Prompt the user for their credentials and use basic authentication - 4: Allow user to select later - 5: Use cookie-based authentication | 0 | No |
gatewayprofileusagemethod:i:value | Specifies whether to use default RD Gateway settings. | - 0: Use the default profile mode, as specified by the administrator - 1: Use explicit settings, as specified by the user | 0 | No |
gatewayusagemethod:i:value | Specifies when to use an RD Gateway for the connection. | - 0: Don't use an RD Gateway - 1: Always use an RD Gateway - 2: Use an RD Gateway if a direct connection cannot be made to the RD Session Host - 3: Use the default RD Gateway settings - 4: Don't use an RD Gateway, bypass gateway for local addresses Setting this property value to 0 or 4 are effectively equivalent, but setting this property to 4 enables the option to bypass local addresses. | 0 | No |
promptcredentialonce:i:value | Determines whether a user's credentials are saved and used for both the RD Gateway and the remote computer. | - 0: Remote session will not use the same credentials - 1: Remote session will use the same credentials | 1 | No |
authentication level:i:value | Defines the server authentication level settings. | - 0: If server authentication fails, connect to the computer without warning (Connect and don't warn me) - 1: If server authentication fails, don't establish a connection (Don't connect) - 2: If server authentication fails, show a warning and allow me to connect or refuse the connection (Warn me) - 3: No authentication requirement specified. | 3 | No |
enablecredsspsupport:i:value | Determines whether the client will use the Credential Security Support Provider (CredSSP) for authentication if it is available. | - 0: RDP will not use CredSSP, even if the operating system supports CredSSP - 1: RDP will use CredSSP if the operating system supports CredSSP | 1 | Yes |
disableconnectionsharing:i:value | Determines whether the client reconnects to any existing disconnected session or initiate a new connection when a new connection is launched. | - 0: Reconnect to any existing session - 1: Initiate new connection | 0 | Yes |
alternate shell:s:value | Specifies a program to be started automatically in the remote session as the shell instead of explorer. | Valid path to an executable file, such as 'C:ProgramFilesOfficeword.exe' | Yes |
Session behavior
RDP setting | Description | Values | Default value | Windows Virtual Desktop support |
---|---|---|---|---|
autoreconnection enabled:i:value | Determines whether the client will automatically try to reconnect to the remote computer if the connection is dropped, such as when there's a network connectivity interruption. | - 0: Client does not automatically try to reconnect - 1: Client automatically tries to reconnect | 1 | Yes |
bandwidthautodetect:i:value | Determines whether automatic network type detection is enabled | - 0: Disable automatic network type detection - 1: Enable automatic network type detection | 1 | Yes |
networkautodetect:i:value | Determines whether or not to use automatic network bandwidth detection. Requires bandwidthautodetect to be set to 1. | - 0: Don't use automatic network bandwidth detection - 1: Use automatic network bandwidth detection | 1 | Yes |
compression:i:value | Determines whether bulk compression is enabled when it is transmitted by RDP to the local computer. | - 0: Disable RDP bulk compression - 1: Enable RDP bulk compression | 1 | Yes |
videoplaybackmode:i:value | Determines if the connection will use RDP-efficient multimedia streaming for video playback. | - 0: Don't use RDP efficient multimedia streaming for video playback - 1: Use RDP-efficient multimedia streaming for video playback when possible | 1 | Yes |
Device redirection
RDP setting | Description | Values | Default value | Windows Virtual Desktop support |
---|---|---|---|---|
audiocapturemode:i:value | Microphone redirection: Indicates whether audio input redirection is enabled. | - 0: Disable audio capture from the local device - 1: Enable audio capture from the local device and redirection to an audio application in the remote session | 0 | Yes |
encode redirected video capture:i:value | Enables or disables encoding of redirected video. | - 0: Disable encoding of redirected video - 1: Enable encoding of redirected video | 1 | Yes |
redirected video capture encoding quality:i:value | Controls the quality of encoded video. | - 0: High compression video. Quality may suffer when there is a lot of motion. - 1: Medium compression. - 2: Low compression video with high picture quality. | 0 | Yes |
audiomode:i:value | Audio output location: Determines whether the local or remote machine plays audio. | - 0: Play sounds on the local computer (Play on this computer) - 1: Play sounds on the remote computer (Play on remote computer) - 2: Do not play sounds (Do not play) | 0 | Yes |
camerastoredirect:s:value | Camera redirection: Configures which cameras to redirect. This setting uses a semicolon-delimited list of KSCATEGORY_VIDEO_CAMERA interfaces of cameras enabled for redirection. | - * : Redirect all cameras - List of cameras, such as camerastoredirect:s:?usb#vid_0bda&pid_58b0&mi - One can exclude a specific camera by prepending the symbolic link string with '-' | Don't redirect any cameras | Yes |
devicestoredirect:s:value | Plug and play device redirection: Determines which devices on the local computer will be redirected and available in the remote session. | - *: Redirect all supported devices, including ones that are connected later - Valid hardware ID for one or more devices - DynamicDevices: Redirect all supported devices that are connected later | Don't redirect any devices | Yes |
drivestoredirect:s:value | Drive/storage redirection: Determines which disk drives on the local computer will be redirected and available in the remote session. | - No value specified: don't redirect any drives - * : Redirect all disk drives, including drives that are connected later - DynamicDrives: redirect any drives that are connected later - The drive and labels for one or more drives, such as 'drivestoredirect:s:C:;E:;': redirect the specified drive(s) | Don't redirect any drives | Yes |
keyboardhook:i:value | Determines when Windows key combinations (WIN key, ALT+TAB) are applied to the remote session for desktop connections. | - 0: Windows key combinations are applied on the local computer - 1: Windows key combinations are applied on the remote computer when in focus - 2: Windows key combinations are applied on the remote computer in full screen mode only | 2 | Yes |
redirectclipboard:i:value | Clipboard redirection: Determines whether clipboard redirection is enabled. | - 0: Clipboard on local computer isn't available in remote session - 1: Clipboard on local computer is available in remote session | 1 | Yes |
redirectcomports:i:value | COM ports redirection: Determines whether COM (serial) ports on the local computer will be redirected and available in the remote session. | - 0: COM ports on the local computer are not available in the remote session - 1: COM ports on the local computer are available in the remote session | 0 | Yes |
redirectprinters:i:value | Printer redirection: Determines whether printers configured on the local computer will be redirected and available in the remote session | - 0: The printers on the local computer are not available in the remote session - 1: The printers on the local computer are available in the remote session | 1 | Yes |
redirectsmartcards:i:value | Smart card redirection: Determines whether smart card devices on the local computer will be redirected and available in the remote session. | - 0: The smart card device on the local computer is not available in the remote session - 1: The smart card device on the local computer is available in the remote session | 1 | Yes |
usbdevicestoredirect:s:value | USB redirection | - *: Redirect all USB devices that are not already redirected by another high-level redirection - {Device Setup Class GUID}: Redirect all devices that are members of the specified device setup class - USBInstanceID: Redirect a specific USB device identified by the instance ID | Don't redirect any USB devices | Yes |
Display settings
RDP setting | Description | Values | Default value | Windows Virtual Desktop support |
---|---|---|---|---|
use multimon:i:value | Determines whether the remote session will use one or multiple displays from the local computer. | - 0: Don't enable multiple display support - 1: Enable multiple display support | 1 | Yes |
selectedmonitors:s:value | Specifies which local displays to use from the remote session. The selected displays must be contiguous. Requires use multimon to be set to 1. Only available on the Windows Inbox (MSTSC) and Windows Desktop (MSRDC) clients. | Coma separated list of machine-specific display IDs. IDs can be retrieved by calling mstsc.exe /l. The first ID listed will be set as the primary display in the session. | All displays | Yes |
maximizetocurrentdisplays:i:value | Determines which display the remote session goes full screen on when maximizing. Requires use multimon to be set to 1. Only available on the Windows Desktop (MSRDC) client. | - 0: Session goes full screen on the displays initially selected when maximizing - 1: Session dynamically goes full screen on the displays touched by the session window when maximizing | 0 | Yes |
singlemoninwindowedmode:i:value | Determines whether a multi display remote session automatically switches to single display when exiting full screen. Requires use multimon to be set to 1. Only available on the Windows Desktop (MSRDC) client. | - 0: Session retains all displays when exiting full screen - 1: Session switches to single display when exiting full screen | 0 | Yes |
screen mode id:i:value | Determines whether the remote session window appears full screen when you launch the connection. | - 1: The remote session will appear in a window - 2: The remote session will appear full screen | 2 | Yes |
smart sizing:i:value | Determines whether or not the local computer scales the content of the remote session to fit the window size. | - 0: The local window content won't scale when resized - 1: The local window content will scale when resized | 0 | Yes |
dynamic resolution:i:value | Determines whether the resolution of the remote session is automatically updated when the local window is resized. | - 0: Session resolution remains static for the duration of the session - 1: Session resolution updates as the local window resizes | 1 | Yes |
desktop size id:i:value | Specifies the dimensions of the remote session desktop from a set of pre-defined options. This setting is overridden if desktopheight and desktopwidth are specified. | -0: 640×480 - 1: 800×600 - 2: 1024×768 - 3: 1280×1024 - 4: 1600×1200 | 1 | Yes |
desktopheight:i:value | Specifies the resolution height (in pixels) of the remote session. | Numerical value between 200 and 8192 | Match the local computer | Yes |
desktopwidth:i:value | Specifies the resolution width (in pixels) of the remote session. | Numerical value between 200 and 8192 | Match the local computer | Yes |
desktopscalefactor:i:value | Specifies the scale factor of the remote session to make the content appear larger. | Numerical value from the following list: 100, 125, 150, 175, 200, 250, 300, 400, 500 | 100 | Yes |
RemoteApp
404bypass 1 0 4 – Redirection Made Easy Home Page
RDP setting | Description | Values | Default value | Windows Virtual Desktop support |
---|---|---|---|---|
remoteapplicationcmdline:s:value | Optional command-line parameters for the RemoteApp. | Valid command-line parameters. | No | |
remoteapplicationexpandcmdline:i:value | Determines whether environment variables contained in the RemoteApp command-line parameter should be expanded locally or remotely. | - 0: Environment variables should be expanded to the values of the local computer - 1: Environment variables should be expanded to the values of the remote computer | 1 | No |
remoteapplicationexpandworkingdir:i:value | Determines whether environment variables contained in the RemoteApp working directory parameter should be expanded locally or remotely. | - 0: Environment variables should be expanded to the values of the local computer - 1: Environment variables should be expanded to the values of the remote computer. The RemoteApp working directory is specified through the shell working directory parameter. | 1 | No |
remoteapplicationfile:s:value | Specifies a file to be opened on the remote computer by the RemoteApp. For local files to be opened, you must also enable drive redirection for the source drive. | Valid file path. | No | |
remoteapplicationicon:s:value | Specifies the icon file to be displayed in the client UI while launching a RemoteApp. If no file name is specified, the client will use the standard Remote Desktop icon. Only '.ico' files are supported. | Valid file path. | No | |
remoteapplicationmode:i:value | Determines whether a connection is launched as a RemoteApp session. | - 0: Don't launch a RemoteApp session - 1: Launch a RemoteApp session | 1 | No |
remoteapplicationname:s:value | Specifies the name of the RemoteApp in the client interface while starting the RemoteApp. | App display name. For example, 'Excel 2016.' | No | |
remoteapplicationprogram:s:value | Specifies the alias or executable name of the RemoteApp. | Valid alias or name. For example, 'EXCEL.' | No |