WordPress Default .htaccess file

Understanding the WordPress Default .htaccess Rules in full

The code inserted in a file in WordPress root directory folder and wondered what its purpose is. In short, it allows permalinks to work. If that’s not an adequate explanation, and you’d like to really understand what every character means and what its purpose is, this article is for you. We’re going to put this code under a big magnifying glass. In the end, you’ll understand everything there is to know about this block of code.

During installation, WordPress enters the following rules into the .htaccess file in its installation root. This is assuming you are using Apache server software. This is the most commonly used server software. Other software uses different methods to achieve permalink functionality. These other methods are outside the scope of this article. These .htaccess rules are not inserted, however, if you chose the “default” (none) permalink structure. Some themes or plugins may cause additional lines to be entered. These are the rules inserted upon a fresh installation. If there is not a .htaccess file in the installation folder, one is created:

# BEGIN WordPress

<IfModule mod_rewrite.c>

RewriteEngine On

RewriteBase /

RewriteRule ^index\.php$ [L]

RewriteCond %{REQUEST_FILENAME} !-f

RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule . /index.php [L]

</IfModule>

# END WordPress

Many of the above code lines are links to a detailed explanation of the respective line. (Rollover to identify links) The section headings that each link leads to is a link to the official reference at apache.org. If your WordPress installation is not in your site’s public html root, the RewriteBase and final RewriteRule will include the path to your WordPress installation folder.

The main purpose of this rule set is to allow arbitrary paths (permalinks) be sent to the proper WordPress script without causing file/path not found 404 errors. If your permalinks work but you see no .htaccess file on your server, it is because it is hidden. The Linux operating system treats any filename beginning with a dot (.) as a hidden file. Your FTP client has a setting somewhere to enable viewing of hidden files. Select that setting and .htaccess will be visible.

The first and last lines starting with # are comments so you know how these rules ended up in your .htaccess file. WordPress core code uses these comments to locate the related code when it needs to alter the rules for various reasons. They do nothing on their own and serve no other purpose. Any line where the first character is a # is a comment.

The <IfModule mod_rewrite.c> and </IfModule> lines work as a pair and prevent errors if your server does not have the mod_rewrite.c module installed. If the module is missing, the lines in between are ignored. Even if you’re sure your server will always have this module available, you may wish to leave these lines in place so if the module becomes unavailable for any reason, your site will not break.

 RewriteEngine On
This line tells the server to process all following lines beginning with Rewrite* up to the next RewriteEngine line as one logical group. You could set the engine to Off to not process any rules. During testing, this is much easier than commenting out every rule.
 RewriteBase /
This line defines the base from which all relative references are taken. A lone / means the base is your site’s public html root. The actual value will be the path to the installation folder for WordPress. If your blog index page is accessed by http://example.com/myblog/index.php, the line would read RewriteBase /myblog/.
 RewriteRule ^index\.php$ - [L]

This rule prevents any reference to index.php from being processed farther down as a permalink, because it’s not one. This will make more sense in a while. As this is the first rewrite rule, with no conditions above it, this rule is always processed. The rule basically says if the text index.php matches the request portion after the base definition, pass the request along unchanged and do not process any more rules. Let’s take a closer look.

All RewriteRule directives have two arguments and an optional flag setting. The first argument is a regexp (regular expression) to attempt to match against the request. The second argument is what to rewrite if there is a match of the first argument. In our case, is a “Last” flag telling the rewrite engine to not process any more rules if there’s a match to the first argument. The second argument in our case is -, which is a special character telling the engine to not actually rewrite anything, to only do what the flags indicate if there’s a match.

The first argument ^index\.php$, is a regexp, where several characters have special meaning. In this case, they are ^\.$ All other characters are to be literal matches to the request above the base definition. So the regexp index alone means the request must have the corresponding text index somewhere in its content. The ^ character means the match must start at the beginning of the request. Since our base is / (root), ^index means either match a file or folder in root that begins with index. So indexfolder/file.php would match this example regexp fragment. So would indexfile.php. However, sindex.php would not match, since the i is not the first character. In order to match, index has to be the first 5 characters.

In a regexp, the dot . means match any character exactly once. Since we want to only match an actual dot, not any character, we indicate so with a \ backslash preceding the dot. So the regexp ^index. (with a dot but without the \) will match any character after the x, such as indexQmore.php, but ^index\. will only match something with an actual dot after the x, like index.more.php. So now, ^index\.php means the request must start with index.php, such as index.php.moretext. However, the $ means match the very end of the request. So now we have the full ^index\.php$ where the only possible match is index.php. Nothing else will match, index.php.moretext will not match. pre.index.php will not match.
up to full script

 RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond means a condition must be true in order for the next RewriteRule to be processed. %{REQUEST_FILENAME} is a variable set by the server to contain the request URL, not just a filename as it may appear. The -f flag without the ! means the condition is true if the first argument resolves to a valid file. The ! negates the flag, so now with the full !-f the condition is true if the first argument does NOT resolve to a valid file. Since permalinks should not point to any valid system filename, a typical permalink will cause this condition to be true. A reference to a valid server file will cause this condition to be false.
 RewriteCond %{REQUEST_FILENAME} !-d
This is similar to the first condition, except now we’re checking for valid directories (the -d flag) instead of files. Both conditions must be true for the next rewrite rule to be processed. The following rule will only be processed if the request is not a valid file and it is not a valid folder either. If the request is either a valid folder and/or it’s a valid file, the following rule is not processed and the request is passed on unchanged, meaning the file is served normally as though there was no rewrite rule in place.
 RewriteRule . /index.php [L]

This rule is essentially only processed if the request is some sort of permalink. Any other valid file system path is passed on without change. Once again, there are two arguments and a flag. The flag once again means do not process any other rules after this one. There are often no other rules after this, but it is placed here just to be safe. The dot . means match any one character. The /index.php means replace the entire original request with /index.php. If your WordPress installation is above your public html root, you will see the actual folder path here as well. This rule basically says send any permalink requests to index.php for further processing by WordPress. WordPress gets the original request from a different variable, so it doesn’t matter if it gets rewritten here, WordPress will still know what the original request was.

Though the request is sent to the new location (index.php), the user’s browser continues to display the original request in its address bar. This is by design for internal references. External references (URLs that include the http://www.domain.com portion) result in a 302 server response (temporary redirect) and the address bar changes.

The / preceding index.php means this is not a relative link, so the initial RewriteBase / directive does not affect the resulting path. If we omitted the / and just had index.php, we would have a relative link, so the base would be applied before it. Since the base is /, we end up with the same file path either way in this particular case.

Why do we match just one character with the dot (.) argument? Shouldn’t we match the entire request by using .*? We could. But there’s no point. Since the match is not in parenthesis, and there is no $1 style back reference in the /index.php parameter back to any such parenthesis, this means no forward reference is used and the entire request is discarded, to be replaced in its entirety with the next argument, /index.php. It’s a bit more efficient to match any one character than all of them. Since we are required to provide some kind of regexp, a simple dot is the most expedient.

If the original request is always discarded, and previous RewriteCond lines determine if the rewrite is performed, what is the point of requiring a regexp then? In this case, it serves no purpose, thus the dot . is the most expedient regexp we can provide. But in many other situations, the regexp is used to match particular portions of the request. Those portions can then be back referenced in the rewrite parameter to feed useful information from the original request to the new rewritten page. The RewriteRule functionality is much more powerful than what we need here, but it’s getting off topic to discuss in any more detail. That’s for another day.

Now that we see how all permalink requests get sent to index.php, the reason for earlier line RewriteRule ^index\.php$ - can be more clearly seen. Rewritten requests are also evaluated by .htaccess rules just as a fresh request would be. The first RewriteRule line keeps the rewritten request (or a basic initial index.php request) from being re-evaluated for possible permalink handling, as it can’t possibly be a permalink. Besides preventing an endless loop, it’s just more efficient.

If not for these rules, all permalinks would throw a 404 error before WordPress ever got a chance to process the links. What was once mysterious gibberish should at least make some sense by now. As with any computer script, once you understand what the various code bits mean and what is done with the information, it’s not all that complicated. read more on wordpress websites

Creating a MySQL database for WordPress

Creating a MySQL database with cPanel, which is included in all of hosting plans(may differ with different hosting providers), can be easily accomplished.

Create a MySQL database on your hosting account, you need to log in control Panel. This can be done by either using the Go to cPanel button in the Customer Area My Accounts section or by entering one of the following URLs in your web browser:

http://yourdomainname.com/cpanel

 

Creating MySQL Database with cpanel

In order to connect a new database you need to enter the desired name of the database in the New Database field and click on the Submit button as shown below:

enter your details to create wordpress database

Hint enter keyword into Table Prefix e.g. wp_horseriding to avoid spam emails. Spammers search the internet for newly installed wp_ databases. And make note of Username and password.

WordPress Login Screen

A confirmation screen will be displayed, informing that the database has been successfully created.

Next Run the install

WordPress Login Screen

Publish button changed to Submit For Review

How to Fix wordpress Publish button in  from Submit For Review

One of the latest problems i have the (pain) pleasure to come across to during a local business wordpress themes design. It really started off as a bit of a nightmare, when i of realised I could no longer add new pages to my WordPress site or even save the customiser settings for our theme either, faced this problem when working on a custom wordpress roofing theme but found the answer after 6ish hours.

The problem was, there was no “Publish” button. The ‘Publish’ button had be replaced by a “Submit For Review” button. Plus when saving the custom preview seemed to work, but after reloading the page were back to the old settings.

I hope my wordpress tips will help you fix your WordPress website fast and get your website working for you, and not you working for your website.

  1. Changing themes can cause this problem. I recommend you switch back to a default theme (i.e. twenty eleven, twenty twelve etc.) and test if the problem still occurs.
  2. Plugins can also cause this problem. To verify if this is the problem, I recommend deactivating or moving your plugins to a directory outside of the folder and see if the problem still happens.

Login to your phpMyAdmin, repairing the database tables. This can solve the problem.
The WordPress “Publish” button is a “Submit For Review” button problem can also be caused my not having a ‘Primary Key’ and ‘Auto Increment’ in the wp-post table in your database
You can hire me to do this for you. Basically login to your phpMyAdmin and go to the table wp-post. You will see the following error, suggesting that there is no ‘Primary Key’ nor ‘Auto Increment’.

Go to ‘Structure’ and on the ‘ID’ row, click on ‘Primary Key’ to make this this primary row. Once the ‘ID’ row is the ‘Primary Key’ you can then edit the ‘ID’ row and set it to Auto Increment.

 

Pinguis Web dealing with WordPress Errors and custom WordPress Website Designers

WordPress Update Services

WordPress Update Services are tools which are used to let other people know you’ve updated your blog.

WordPress automatically updates popular Update Services when you have updated your blog by sending pings each time you create or update a post.

Listed below are Ping Services WordPress uses:

http://rpc.pingomatic.com
http://rpc.twingly.com
http://api.feedster.com/ping
http://api.moreover.com/RPC2
http://api.moreover.com/ping
http://www.blogdigger.com/RPC2
http://www.blogshares.com/rpc.php
http://www.blogsnow.com/ping
http://www.blogstreet.com/xrbin/xmlrpc.cgi
http://bulkfeeds.net/rpc
http://www.newsisfree.com/xmlrpctest.php
http://ping.blo.gs/
http://ping.feedburner.com
http://ping.syndic8.com/xmlrpc.php
http://ping.weblogalot.com/rpc.php
http://rpc.blogrolling.com/pinger/
http://rpc.technorati.com/rpc/ping
http://rpc.weblogs.com/RPC2
http://www.feedsubmitter.com
http://blo.gs/ping.php
http://www.pingerati.net
http://www.pingmyblog.com
http://geourl.org/ping
FREE Netflix Accounts Email & Password 17 May 2020
http://www.weblogalot.com/ping

Update service URL’s are listed under “Update Services” under Settings-> Writing Settings

WordPress Address None www. or with www.

WordPress Address www. or none www.

How to get www. before your domain name on your WordPress Website.

Ultimately, it doesn’t really matter which one you choose. The success of your website will not be determined by a www or non-www URL. The important thing is that whichever one you choose be accurate and consistent.

If visitors type to www.pinguisweb.com or chose to type pinguisweb.com they will still find the Number 1 “Website Design Kerry” website.

In fact when you visit www.pinguisweb.com, the www will not be displayed in the browser’s address bar.

Its assumed when you are searching the world wide web that www. is there.

As long as the domain name is identical there will be no problem with WordPress. Its written into the .htaccess file WordPress has Rewrite Rules to correct this.

To change to either on the left hand black bar go to settings and general. Basically its a matter of choice.

Just be consistent throughout.

Of course, WordPress changes everything when you go installing it in a sub domain and linking it back to you main domain.

WordPress Media Settings

WordPress Media Settings

Media Settings are controlled by the various settings related to images and other media that are used in writing posts and pages.

The image sizes listed determine the maximum dimensions in pixels to use when inserting an image into the body of a post.

  • Thumbnail size – Specify the Width and Height of your Thumbnail
    Crop thumbnail to exact dimensions (normally thumbnails are proportional)
  • Medium size – Specify the the Max Width and Max Height
  • Large size –  Specify the the Max Width and Max Height

Uploading Files

Default settings used for during the media upload process when writing a post.

  • Organize my uploads into month- and year-based folders – Check this box if you wish to organize your uploads into folders based on the year and the month of the upload. WordPress will automatically create the folders, such as wp-content/uploads/2010, these folders are well organised and easy to browse, if you need.

Save Changes Button

Click the Save Changes button to ensure your changes are saved(committed) to your database. Your settings have been saved.
Remember that some plugins require additional image sizes and will create them based on their specifications. One of the main reasons for WordPress site being bloated or taking up to much room.

WordPress Discussion Settings

How to setup WordPress Discussion Settings or Comments.

Default article settings WordPress will send out a pings to a site or article you have linked to in your post automatically.

Trackbacks allows you to communicate to another blog or blog owner using your WordPress

Pingbacks are sent automatically when you link to someone’s site or they link to you.


Other comment settings

I dont allow comments on my websites as a rule.

My settings are: Comment author must fill out name and email.

Users must be registered and logged in to comment.

set to 0 days

Email me whenever

A comment is held for moderation

Before a comment appears

Comment must be manually approved.

Comment author must have a previously approved comment

 

I hate spam so hold a comment in the queue if it contains or more links. (A common characteristic of comment spam is a large number of hyperlinks.)

Below are avatar settings

Avatar Display
Avatar Display

Maximum Rating
Maximum Rating




Default Avatar
Default Avatar

For users without a custom avatar of their own, you can either display a generic logo or a generated one based on their email address.

WordPress Reading Settings

WordPress Reading Settings Control your frontpage Settings

Front Page Display Setting choose what content appears on your website’s front page. Choose to have your latest blog posts or a static page. Created in the Pages tab (black bar left hand sidebar) of your site.

Your front page is set to display your latest blog posts by default, this can change it to a static front page. Using a static front page is handy if you want to use your front page as a landing page.

Blog pages show at most – Controls the number of Posts to display on your blog page. If frontpage display is set to display Your Latest Posts this value is controlled here also.

Syndication feeds show the most recent – These feeds show the most recent items and lets you set how many blog posts will be sent out at via RSS feed (mine is located at http://pinguisweb.com/feed/). Add /feed/ to your wordpress domain name to get your feed address.

For each article in a feed, show – choose whether to show all post content or the first 55 words, you can select Full text or Summary. Full text means that the entire contents of a post are included in the feed. Summary means that only the first 55 words are included in the feed, along with the option to continue reading the rest of the post. Best change to Summary because of pagespeed and bandwidth factors.

Search Engine Visibility – If you want to setup your website before indexig check the Discourage search engines from indexing this site box to ask search engines not to index this site. When the option is checked, this changes robots.txt to send back noindex(Disallow) commands to search engines.

Writing Settings WordPress

How to change the Writing Settings WordPress

WordPress has a lot of Default Setting already set to help you get started quickly. Reading Settings is no different but can be tweeked to get the results that push you up from amateur status.

It not going to change the world but may improve your blog rating that bit.

 

Writing Settings in WordPress

Convert emoticons like and to graphics on display – i would tick YES
WordPress should correct invalidly nested XHTML automatically – i would tick YES

Default Post Category for this one i would select a popular search term related to my business. These categories are set in All Posts and Category. Enter your category information there and come back and select it from the list.

Default Post Format I always leave it to standard the choices are Standard, Aside, Chat, Gallery, Link, Image, Quote, Status, Video or Audio. Again depends on you type of blog or customers.

WordPress General Settings

How to set your General Website Settings in WordPress

One of the first pages to visit in the WordPress back-end is your Settings Screen. Down the left hand side bar under settings, you can set control of the most basic configuration settings for your site, your site’s title and location, who can register an account at your site, and how dates and times are used and displayed.

Below is an example of the setting used in Ireland. We will explain…

Changing Website Title and Tagline are pretty simple.

Changing the Email Address associated with the Administrator is next input box.

Timezone should be set to Dublin as Cork is not there and Kerry has none(Yet).

Date Format is a personal choice but i recommend Date/Month/Year as its standard in Ireland..

Time Format again is a personal choice i would keep it at default Hour/Minute/ in 12-hour clock.

Select Week Starts On Day and the Default WordPress Site Language

Hit Save Changes…