.htaccess

.htaccess

.htaccess

 
 

Example of URI Redirects in a WP Site:

[root@ca-web1 aiglebleu.org]# cat .htaccess 
# Redirects
<IfModule mod_rewrite.c>
RewriteCond %{REQUEST_URI} (entag/)(.*)
RewriteRule ^(.*)entag/(.*)$ http://www.aiglebleu.org/en/$2 [NC,L]

RewriteCond %{REQUEST_URI} totem\ animals/
RewriteRule ^(.*)totem\ animals/$ http://www.aiglebleu.org/en/category/totem-animals/ [NC,L]
</IfModule>

# 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
    • Related Articles

    • Common .htaccess Redirects

      #301 Redirects for .htaccess #Redirect a single page: Redirect 301 /pagename.php http://www.domain.com/pagename.html #Redirect an entire site: Redirect 301 / http://www.domain.com/ #Redirect an entire site to a sub folder Redirect 301 / ...
    • Common .htaccess Redirects

      #301 Redirects for .htaccess #Redirect a single page: Redirect 301 /pagename.php http://www.domain.com/pagename.html #Redirect an entire site: Redirect 301 / http://www.domain.com/ #Redirect an entire site to a sub folder Redirect 301 / ...
    • Creating a .htaccess for redirects

      1. Create an empty text file using a text editor such as notepad, and save it as htaccess.txt. NOTE: The reason you should save the file as htaccess.txt is because many operating systems and FTP applications are unable to read or view .htaccess files ...
    • CMS Brute Force Protection - htaccess

      Content management systems (CMS) such as Wordpress and Joomla! have become regular targets of brute force attempts. The most common way these types of attacks are performed is by hitting the wp-admin.php and administrator/index.php with thousands of ...
    • Force SSL with htaccess on linux

      if you already have a .htaccess just edit it using the same command above. Add the following contents to it: SSLOptions +StrictRequire SSLRequireSSL SSLRequire %{HTTP_HOST} eq "domainname.com" Save and exit. Make sure that the permission ...