top of page

Structure of .htaccess file in wordpress

  • Writer: سُلَيْمَان بْن دَاوُوْد
    سُلَيْمَان بْن دَاوُوْد
  • Jan 5, 2025
  • 1 min read

When we are placing our word press site in root directory of server then .htaccess looks like


# 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

When we are placing word press in a sub directory then .htaccess looks like this

suppose my sub folder name is barraid


# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /barraid/
RewriteRule ^index\.php$ – [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /barraid/index.php [L]
</IfModule>
# END WordPress

Recent Posts

See All
Securing a VPS with some Ways

Change the Default SSH Port maybe to something like 27765 which is difficult to guess Disable Root Login Using SSH Keys(Public Key)...

 
 
 

Comments


© 2020 by syednazrulhassan

bottom of page