Tag Archives: Web development

The Best Web Development Choice I Ever Made!

The Evolution of My Web Development Environment

The Early Days: Manual Setup

When I first dipped my toes into Web Development, I embraced the challenge of manually installing and configuring PHP, Apache, and MySQL on my Windows machine. It was a steep learning curve, but it worked, and I felt accomplished.

The VM Era: Convenience and Performance

As time passed, I discovered the power of virtual machines (VMs). I started with Windows Virtual PC, later adopting user-friendly solutions like XAMPP and WampServer. This setup served me well, and I eventually upgraded to VMWare for better virtualization.

The Performance Dilemma

However, the arrival of Windows 10 and VMWare 14-15 brought an unexpected challenge: a significant drop in performance. Simple tasks that once took milliseconds now lagged for 5-8 seconds. Switching to VirtualBox offered some improvement, but it never matched the speed I remembered from less powerful machines.

Frustrated, I spent countless hours attempting to tweak PHP, Apache, and MySQL settings, all to no avail. I tried creating fresh Windows 7, 10 & 11 machines, but the performance issues persisted in all cases, eating into my daily productivity and patience.
 
Continue reading

PHP Connection To Azure SQL Database

For those of you Web App developers, here’s how you setup PHP so you can work with an Azure SQL Database.

It’s a 3 part process, beyond your actual PHP code:

  • Install the Microsoft ODBC Driver
  • Install the Microsoft Drivers for PHP for SQL Server
  • Configure PHP

Continue reading

The Day I Stopped Using FireFox

Goodbye

So yesterday, I received a nice notification from Google:

Our team has reviewed your content, and, unfortunately, we think it violates our harmful and dangerous policy. We’ve removed the following content from YouTube:
 
URL: ht​tps://www.​devhut.​net/bypassing-microsofts-new-blocking-of-macros-vba-code/
Video where URL was found: Understanding Macro Blocking and Unblocking Google

Side note: GMail report Google’s own e-mail to me as “This message seems dangerous”!

Once Google did this, my webpage via Firefox started to load to:

Continue reading

WordPress Open Link in New Window Plugin

Many of the sites I create are done in WordPress, it simply works! That said, one of my peeves over the years has been the need to manually edit each link to open in a new window so users don’t loose the page they are on. This week I finally decided to use this as an excuse to learn about developing WordPress PlugIns and created my own for this purpose. Things went very well and I plan on continuing development and adding other features that I feel can help me as a developer and author.

As such, I thought I’d share it here. (Yes, I will be looking into publishing it through the WordPress.org portal)

Continue reading

htaccess Force https on Domain but not on SubDomain

I recently wanted to setup SSL on 2 of my websites.  So I purchased the SSL Certificates and performed the installation through my host’s domain portal.

My host modified my default .htaccess file by adding

#RewriteEngine On
#RewriteCond %{SERVER_PORT} 80
#RewriteRule ^(.*)$ https://DomainName.com/$1 [R=301,L]

The problem was that I had a subdomain, for personal use, on one of my domains and I did not want to force https on it since my SSL certificate was only for the main domain.  The above ReWrite rule is indiscriminant and forces https on all urls.  I contacted my host and they weren’t very helpful, so I knew I was on my own to figure this one out.

I won’t bore you with all the variations I tried (hours of Googling and trying this and that), but below was what finally worked for me to exclude a subdomain from being forced into https.

RewriteEngine On
RewriteCond %{SERVER_PORT} 80
#Exclude subdomain from rewrite rule
RewriteCond %{REQUEST_URI} !^/SubDomainName/
RewriteCond %{HTTP_HOST} !=SubDomainName.DomainName.com [NC]
#rewrite the url to force the use of https
RewriteRule ^(.*)$ https://DomainName.com/$1 [R=301,L]

 

So let explain the 2 critical new lines:

RewriteCond %{HTTP_HOST} !=SubDomainName.DomainName.com [NC]

This one is pretty self-explanatory, if a request is made to access SubDomainName.MyDomainName.com then you do not (!) apply the following Rewrite Rule.

RewriteCond %{REQUEST_URI} !^/SubDomainName/

This one on the other hand may not be so obvious.  My host was automatically redirecting request for

SubDomainName.DomainName.com

to

DomainName.com/SubDomainName

so I needed to add another Rewrite Condition to also exclude such a request from being forced into https.  You may not need to include this condition on how your host has things setup.

 

Robot.txt

One last additional tidbit.  While trying to figure out the above I came across a posting in which they stated that an exclusion for the robot.txt should be made so it does not require https.  To do so, you would add one more Rewrite Conditon

RewriteCond %{REQUEST_URI} !/robots.txt

 

So the final htaccess would then become

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{SERVER_PORT} 80
#Exclude robot.txt from rewrite rule
RewriteCond %{REQUEST_URI} !/robots.txt
#Exclude subdomain from rewrite rule
RewriteCond %{REQUEST_URI} !^/SubDomainName/
RewriteCond %{HTTP_HOST} !=SubDomainName.DomainName.com [NC]
#rewrite the url to force the use of https
RewriteRule ^(.*)$ https://DomainName.com/$1 [R=301,L]
</IfModule>

 

Resources

While trying to figure this all out, I came across a few good sites, should you wish to delve deeper into the matter:

Disclaimer
Let me be explicitly clear, I am not an htaccess experts by any means.  I simply managed to piece the above together out of personal necessity.  Just because it worked for me does not guarantee it will work for you, nor should any assumptions be made that it is the best approach to the matter.

As with any post on my site, I am always open to better ways of doing things, and learning, so feel free to leave a comment if you can add constructive information to the above.

Create an Apache Sub-Domain

Not long ago, I was looking information on how to create and configure an Apache sub-domain on my test server.  I found a number of websites covering the subject, but even after editing my httpd.conf file to add the domain and sub-domain entries, the sub-domain would not work!?  So I did more digging and testing and what I found was that the various tutorials and explanations all omitted one crucial element to the puzzle, none of them mentioned that you had to also add a subdomain entry to Windows’ host file! I assumed that since the domain already had an entry, Apache & Windows were smart enough to know that a sub-domain would use the same host entry as the domain, I was wrong! Apparently, Apache & Windows are not that smart, actually they appear to be blatantly stupid!

So the first thing you have to do is edit the httpd.conf file to add the required virtual host entries: 1 for the domain & 1 for the sub-domain


    ServerName www.domain.com
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/websites/www.domain.com"


    ServerName subdomain.domain.com
    DocumentRoot "C:/Program Files/Apache Software Foundation/Apache2.2/htdocs/websites/www.domain.com/subdomainFolderName"

But even once this is done, you then have to go and make an entry for both your domain and another for your sub-domain in the Windows Host file.  The values below assume a local test server

127.0.0.1    www.domain.com
127.0.0.1    subdomain.domain.com

Once you make both of these changes, restart your Apache server, and everything should work.  It did for me at least!

SEO Companies – SEO Optimization Service E-mails

If you own a website, you undoubtibly have received beautiful SPAM e-mails from various sources offering you their Search Engine Optimization (SEO) services. Now the following points may be obvious to some, but I thought I’d put them black on white for people who are new to the field, or are simply not aware of a few things in the www.

so you’ve received and e-mail such as (just a few examples)

We offer quality Search Engine Optimization / SEO Services and Internet Marketing Solutions. Our dedicated team of SEO Professionals ensures Top 10 search engine rankings. Our SEO Processes are designed in view of the SEO guidelines, and white hat SEO techniques are strictly followed to ensure that our clients from world over get the best SEO services. Please reply to this email so we can send you more details.

We will optimize your site to increase its rankings with major search engines. This will drive targeted online users to your site, as well as attract new users through the use of relevant keywords and phrases. Not only will we help you gain those higher rankings, but maintain your status through continual management and support. Please reply to this email so we can send you more details.

We noticed that you are not at the top of the search engines for a number of your key terms. We have helped companies similar to yours to achieve top organic rankings. Please reply to this message and we will prepare a special proposal for you, to show you how we can achieve similar results for you.

We are interested to increase traffic to your website, please get back to us in order to discuss the possibility in further detail.

We strongly believe that we have an excellent opportunity to increase the number of visitors to your website through our white-hat SEO services. Please simply reply to this message and we will be delighted to send you further information.

Search Engine Marketing will increase your company’s online presence through comprehensive online marketing campaigns, targeted search engine optimization, and highly managed internet marketing promotions. A search engine marketing campaign will encompass several procedures and factors to make it successful. Please reply to this email so we can send you more details.

We are a leading India based SEO company providing the best search engine optimization services. We act as your business partner and helps you reach your business goals. We promote websites no matter who you are – a huge company with thousands of employees, a small business or a professional who offers professional / consulting services. Let us know if you are interested and we will get back to you with more details.

Hello,

Greetings for the day!

I am xxxxxxx and I am contacting you after looking at your website- .

We are a Leading Indian Based SEO & Web Development Company and one of the very few company which offer organic SEO services with a full range of supporting services such as one way themed text links, blog submissions, directory submissions, article writing and postings, etc.

We are a team of 50+ professionals which includes 18 full time SEO experts. We are proud to inform you that our team handled 100+ SEO projects and obtained 40000+ manually built links in the past 1 year.

We will be glad to assist you with offering our services. Please let me know your Interest so that we can tell you more about Our Services.

Thanks
—————-
xxxxxxx xxxxxxxxxx
Online Marketing Consultant

Now there are a couple reasons why I would never deal with any of these companies:

  1. Firsty, they sent me SPAM!
  2. If I can’t be found on search engines, then how did they find me in the first place?
  3. They always use gmail, hotmail, live e-mail accounts. If they truly were a reputable company they would use their own corporate e-mail address. For me they represent fly by night companies that I would avoid at all cost.
  4. Similarly, in many cases, the e-mail address name does not match the sign-off name in the e-mail. Makes me wonder?!
  5. Why hire a company to do what you can do yourself? SEO is very basic and there are no tricks that they possess that you cannot do yourself with a little time.
  6. Most importantly, any company that promises specific results I would avoid at all costs! No one can guarantee where you will show up on any search engine since the equations behind indexing are private and always changing. A SEO consultant can say they will optimize your site, and should be able to improve your ranking, but to say you will end up on the 1st page is just ridiculous!

Also, please remember that you can’t be at the top of search engine searches for every keyword! So anyone can always claim that you are not at the top of search engine ranking for some keyword. You have to concentrate your efforts on a select group of keywords and work your site around the keywords you have chosen.

Another important thing to note about SEO is that it is an on-going process. There is always more that can be done. So it is important to fix a realistic goal and aim for that. Once you have done your SEO, you should then review your site statistics for a couple week or months, and then define a new attack plan.

At the end of the day though, if you want to get someone to do some SEO for you that is fine, but find yourself a web developer through your network, yellow pages, the person that developed your site. Then validate there abilities by asking for examples and references (anyone can claim to be a SEO expert). Just stay away from the SPAM, unsolicited SEO as they are questionable (refer to the list above).