skip to Main Content

I have hosted my folder on godaddy linux cpanel. WordPress files are in inside /public_html/tma.

I am facing strange issue that my .htaccess file is not working properly.

# 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 I request for this wordpress folder, http://{myip}/{uniquestring}/tma/ then even if it has index.php, it displays 404 error

2

Answers


  1. WordPress recommends this for if your files are in a subdirectory:

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    RewriteCond %{REQUEST_URI} !^/my_subdir/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /my_subdir/$1
    RewriteCond %{HTTP_HOST} ^(www.)?example.com$
    RewriteRule ^(/)?$ my_subdir/index.php [L] 
    </IfModule>
    
    Login or Signup to reply.
  2. Just try adding AllowOverride All in your .htaccess File.

    Thanks.

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search