Redirect once on first visit
Redirect once on first visit
Redirect once on first visit
Getting error when trying to redirect WP site to mobile site
Sounds like your Apache httpd.conf is missing a virtual host entry for port 443. Listen 443 <VirtualHost *:443> ServerName www.foo.com DocumentRoot /var/www/www.foo.com/htdocs CustomLog /var/log/apache/www.foo.com-access.log combined ErrorLog /var/log/apache/www.foo.com-error.log # Example SSL configuration SSLEngine on SSLProtocol all -SSLv2 SSLCipherSuite HIGH:MEDIUM:!aNULL:!MD5 SSLCertificateFile “/var/www/www.foo.com/ssl/server.crt” SSLCertificateKeyFile “/var/www/www.foo.com/ssl/server.key” </VirtualHost> Source: http://wiki.apache.org/httpd/ExampleVhosts
When working with this dev site, i did not want to give it its own domain name, it was to replace the existing server as soon as i had it running. It came down to two things. I had tried an IP here, but had forgotten to include the http://. define( ‘WP_SITEURL’, ‘http://123.456.789.255’ ); define( … Read more
Converted posts to a CPT, 301 redirects necessary?
This can be achieved with Two Cookie. Saves the unix time of user visits first time. Expiration time set to a higher value, A cookie that never expires. Set another cookie that is valid for 24 hours. Code function wpse144762_check_accessed(){ if( !isset($_COOKIE[‘first_time’]) ) { // user visiting for the first time setcookie(‘first_time’, ‘yes’, time() + … Read more
Try this on your .htaccess file. RewriteCond %{HTTP_HOST} ^blog\.example\.com [NC] RewriteRule ^(.*) http://example.com/$1 [L,R=301] It simply redirect blog.example.com to example.com or blog.example.com?p=11 to example.com/?p=11. Source.
I would place the redirect inside WordPress. It lends you more control, and you don’t need to worry about WP conflicting with your own .htaccess rewrites anymore. function wpse_147377_redirect_to_holding() { if ( ! is_page( ‘holding’ ) ) { wp_redirect( site_url( ‘holding’ ) ); exit; } } add_action( ‘template_redirect’, ‘wpse_147377_redirect_to_holding’ ); Place it in a “Must … Read more
Add redirect_to as a query variable in your link whenever you redirect user wp-login.php. Like wp_redirect(‘http://…../wp-login.php?redirect_to=your_previous_page_link’, 302); In redirect_to write the link of any page.
Subpages return 404 server error