• hi,

    i have added .htaccess file. i have installed wordpress in subfolder so that it comes all the pages with subfolder name in webbrowser. i need to hide. please help me how to hide that subfolder name.

    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule (.*) https://domain.com/subfolder [R=301,L]
    </IfModule>

Viewing 6 replies - 1 through 6 (of 6 total)
  • Remove that .htaccess block and see Allow WordPress to take over the root domain.

    Thread Starter johnchs

    (@johnchs)

    Thanks for your replay. but Inside public_html directory I have a subfolder and I have created index.php in that folder.

    All my site url showing

    https://domainname.com/subfolder/pagename

    I want it to rewritten as

    https://domainname.com/pagename

    What rule should I write in .htaccess to show the “https://domainname.com/pagename&#8221;

    After you let WP take over you go into Settings>Permalink and change your structure. ??

    Thread Starter johnchs

    (@johnchs)

    we can’t change permalink. if we change permalink it is not working. only ways to change in .htaccess to hide the subfolder. please help me how to write the rule in in .htaccess.

    Here’s what I did. I changed the permalink structure in the WordPress Dashboard under Settings>Permalink to domain.com/pagename. This breaks the pages temporarily. THEN I made an htc.access file under public_html and put this in it:

    # 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

    I think that should do it and the pages aren’t broken and have custom names.

    Thread Starter johnchs

    (@johnchs)

    inside the public_html directory already one index.php is there. so when i run https://domainname.com that is working with inside the public_html index.php. so that i have created and installed one subfolder with in the subfolder mywebsite is there. so when i run https://domainname.com/subfolder is working. i don’t want like this. i want when i run https://domainname.com/ it will run the index.php within the subfolder but dont want to show the subfolder url in webbrowser.

    The above mentioned .htaccess file only on subfolder directory.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘.htacess file’ is closed to new replies.