Task 25 : WordPress Key Files for SEO Speed Security – .htaccess- WP Spartans 300

.htaccess file is very important for WordPress SEO, Speed and Security. It’s all about Apache Web Server Configration. We can also use it to redirect pages, domains and sub directories. Let’s explore it.

In Task # 25 of our three months absolutely free wordpress training under WordPress Spartans Mission 2019, we discussed the importance, creation and editing of .htaccess file. The ht is for Hyper text. We can upload it to root directory or to any directory (such as wp-content of WordPress Themes).

We also discussed how we can stop bots browsing our directories. How to stop bots from hot linking or sql injections etc. We can also ban certain IPs (sort of blacklisting IPs that try to sniff our content). .htaccess is also used for forced downloads etc.

Use this code for Hot Linking Precaution:

RewriteEngine on
# Options +FollowSymlinks
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^ [NC] RewriteRule .(mp3|jpg|wav)$ – [F]

A great number of Cache plugins such as W3 Total cache add new entries to this file for caching system, browser and header expiry etc.

#Redirect Old Page/ Post to New Post

RewriteEngine On
Redirect 301 /old page or post title here/(one space) http:// or page or post title/

# To redirect whole site (create .htaccess in the root of old site and put this code in it.

Redirect 301 / http:// or website url.com/

# To redirect from main directory to sub directory

Redirect /index.html or php (whatever the extension is) /sub directory name here/

#To avoid 404 error

ErrorDocument 404 http:// or home page.com/

#Loading sub directory from main root

RewriteEngine on
RewriteRule ^$ /any sub directory name/ [L]

#If someone searches a page on site that doesn’t exist, you can redirect as udner.

Options +SymLinksIfOwnerMatch
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]

## آئی پی وغیرہ کو اجازت دیں یا روک دیں ##

order deny,allow
deny from all
allow from
allow from

#WPSpartans300 is a mission. WordPress Developers from all over the world have started taking interest in this initiative. Therefore, I’m putting all my energy to make this journey wonderful and full of success.

Link to Access Top WP Developers Mission 2019:

Or, simply visit and click on 300 Spartan Page.

Through this three months Free WordPress Training (Absolutely FREE), we will learn how to create responsive WordPress Themes and Plugins. We’ll be in a position to sell our assets via Themeforest (Envato) and other platforms. Get ready to conquer that front.

Let me tell you that without passion and commitment, you won’t be able to be a Rockstar WordPress Developer. It does take a lot of hard work ; however, the end result is awesome.

I will guide you step by step so that you could get results from your WordPress Training Mission. Get ready to excel as a professional developer. It’d be fun and exciting adventure.

Fuente – Source

Task 25 : WordPress Key Files for SEO Speed Security – .htaccess- WP Spartans 300

Necesitas ayuda con wp? Entonces WPVideo es tu sitio.
Encuentra lo que buscas entre cientos de miles de videos y experiencias personales de otros usuarios. Todos los que empezamos con wp deberíamos tener acceso a esta web, ojalá yo hubiera tenido algo así cuando empecé mi camino como webmaster 🙂
Pero ahora quiero y puedo poner esta web a vuestra disposición.
Disfrutadla 😉

Need help with wp? Then WPVideo is your site.
Find what you are looking for among hundreds of thousands of videos and personal experiences of other users. All of us who started with wp should have access to this website, I wish I had something like that when I started my journey as webmaster 🙂
But now I want and I can put this website at your disposal.
Enjoy it 😉


Publicado en Plugins, SEO, Temas (Themes), Wordpress y etiquetado .

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *