skip to Main Content

I am working on a wordpress project where i have my project in cpanel file manager

like: /var/www/public_html/myProject

so right now i am accessing this using below url

like: mysites.com/myProject

so i want to access my myProject directory using only my base url that means whenever a user type: mysites.com it should be point to mysites.com but actually page should be display from mysites.com/myProject.

in other cases like

mysites.com/myProject/productList

should be point to
mysites.com/productList

but mysites.com/productList should comes from mysites.com/myProject/productList.

Hope you have understand my question

i think there might be setting in htaccess but i need some help of you to achive it.

2

Answers


  1. Just copy all the files and folders from myProject folder and paste it to public_html. Now all the WorPress files and folders will be in your public_html folder. You can access the site using base url.

    Login or Signup to reply.
  2. Try this .htaccess

    <IfModule mod_rewrite.c>
    RewriteEngine on
    RewriteCond %{HTTP_HOST} ^(www.)?mysites.com$
    RewriteCond %{REQUEST_URI} !^/myProject/
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^(.*)$ /myProject/$1
    RewriteCond %{HTTP_HOST} ^(www.)?mysites.com$
    RewriteRule ^(/)?$ myProject/index.php [L] 
    </IfModule>    
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search