coding – N77 Design | NickClaeboe.com https://www.nickclaeboe.com Atlanta Web, Graphic & Flyer Design • Design Portfolio & Rates for Nick Claeboe Custom Design Work Wed, 03 Mar 2021 14:42:59 +0000 en-US hourly 1 https://wordpress.org/?v=6.5.5 https://www.nickclaeboe.com/wp-content/uploads/2016/05/favicon-60x60.png coding – N77 Design | NickClaeboe.com https://www.nickclaeboe.com 32 32 Rotate URLs with PHP Location Header Exit Code at Fifty Percent Random While Preserving URL string https://www.nickclaeboe.com/2018/06/13/rotate-urls-with-php-location-header-exit-code-at-fifty-percent-random-while-preserving-url-string/ Wed, 13 Jun 2018 11:30:17 +0000 http://www.nickclaeboe.com/?p=557

This is a great piece of code to rotate 2 separate landing page urls using PHP location headers and a 50% random string. This code also preserves the URL string so that any url string variables are sent to the rotated links of the outbound pages.

We achieve this by using a simple redirect script php header.

This snippet of code is excellent for the testing of different landing page offers with different designs and elements, so you may determine which page layout and design performs better.

First, I set up an index.php page in a directory on my site. In this case is was just a simple /r directory. So the file structure would look something like this

https://www.nickclaeboe.com/r/

and the php code would be added to the index.php file in this /r directory.

<?php
if (mt_rand(0,1) == 0) {
header("Location:https://www.nickclaeboe.com/blog/post1/?". $_SERVER['QUERY_STRING']);
exit;
} else {
header("Location:https://www.nickclaeboe.com/blog/post2/?". $_SERVER['QUERY_STRING']);
exit;
}
?>

Using this code, and with it preserving your url string, your traffic link would look something like:

https://www.nickclaeboe.com/r/?yourVariable=this

and with the script above installed on the index.php of the /r directory, the random string in the php snippet will send your traffic to each link approximately 50% of the time, evening out the traffic sent to the 2 pages you are testing. Ultimately, you will see your traffic sent to each page and those links will now look something like this:

https://www.nickclaeboe.com/blog/post1/?yourVariable=this

and

https://www.nickclaeboe.com/blog/post2/?yourVariable=this

I hope this helps you out as much as it’s helped me out.

It’s a very quick and easy way to test 2 separate landing pages with different landing page elements to test what page converts better based on your page variables.

]]>
How to Fix Fatal Error: Maximum Execution Time Exceeded in WordPress https://www.nickclaeboe.com/2016/05/22/how-to-fix-fatal-error-maximum-execution-time-exceeded-in-wordpress/ Sun, 22 May 2016 22:13:51 +0000 http://ec2-54-186-150-17.us-west-2.compute.amazonaws.com/?p=286

I’ve been doing quite a few WordPress sites for clients lately and I use a lot of premium templates from templateforest.net. These templates are great but you can run into php errors with them from time to time dependent on your server’s settings for php. Sooner or later you’re going to run into some kinds of php error and that brings your site to a screeching halt. The most recent error that I encountered was this:

1.Maximum Execution Time (max_execution_time) : 30

I ran into several solutions, or so I thought, to correct this error. Again, dependent on your server’s php settings and where you host your site, this can turn into a giant headache in a hurry. I’m going to give you two methods that work and the one method that worked for me. It saved me so much time and got my project back on track with the client.

Method 1: Editing the .htaccess file

Using your favorite FTP clinet (mine’s Filezilla), edit your .htaccess file that’s located in your site’s root folder, where all of your main WordPress files reside as well.

Right click on the file (in Filezilla) and choose View/Edit and edit the .htaccess file in your text editor of choice. I prefer Notepad++.

At the end of the .htaccess file, paste this snippet of code.

1.php_value max_execution_time 300

This code sets the value for maximum execution time to 30 seconds. Some WordPress templates may require 60 seconds or more, if so, simply change the value to 600 or more dependent on your template’s needs.

Method 2: Editing the wp-config.php file (method that worked for me)

Again, using Filezilla (FTP) to connect to your server, in the root folder of your site, edit the wp-config.php file.

Scroll to the bottom of the file and above the commented out code that reads:

1.“/* That’s all, stop editing! Happy blogging. */”

Paste this snippet of code:

1.set_time_limit(60);

I hope that one of the above methods works for you, the wp-config.php file edit method is what worked for me. Happy coding.

]]>