Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Create .htaccess File through CPanel
#1
Create .htaccess File

How to Create a .htaccess File

There are a few instances where your WordPress installation will not include the .htaccess file by default. Alternatively, a broken plugin might corrupt this server configuration file and disrupt your site. In these cases, you will need to create a new file from your hosting control panel manually.

Hosting Control Panel

Choose the New File button on the upper-left corner of your screen.

New File Option

New File option on cPanel.

Enter .htaccess as the file name, then insert the code below:

# 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

Once you’ve added the code, press Create to save your changes. Keep in mind that the code is universal for all WordPress sites. However, other content management systems (CMSs) will have different code for their .htaccess files.

Aside from the method above, you can also use a text editor such as Notepad to create a .htaccess file, then upload it to your web server using an FTP client.

Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)