Method I as explained in “Giving WordPress Its Own Directory” may be what you are looking for.
Here are the steps:
- After Installing the wordpress in root folder, move EVERYTHING from root folder into subdirectory.
- Create a
.htaccess file in root folder, and put this content inside (just change example.com and my_subdir):
<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>
Hello,
I try without sucess:
# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngineRewriteEngine on
RewriteCond %{HTTP_HOST} ^(www.)?sub.dominio.com$
RewriteCond %{REQUEST_URI} !^/web/
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /web/$1
RewriteCond %{HTTP_HOST} ^(www.)?sub.dominio.com$
RewriteRule ^(/)?$ web/index.php [L]
</IfModule>
# END WordPress
the result is:
“GET / HTTP/1.1” 500 1622 “-” “Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:56.0) Gecko/20100101 Firefox/56.0”
You may have more than one .htaccess file.
Make sure the file is on the root folder and not on /web
I´ve got just one in the root folder.
what can be wrong? i don´t understand the sintax of this file.