0

I have a symfony project . I have deployed it on godaddy shared hosting .
The Dir structure is -

|- godaddy root
   |- site1
   |- site2
   |- symfony_project

I have pointed my symfony site url to symfony_project directory. So if my url is example.com , the page is rendered for the / route . So if I type example.com/web/ , the / route is executed . But any other url does not work , like example.com/web/link1 does not work .. I have tried various modifications of .htaccess , but none seems to work for me . Also if I go through godaddy root url , like godaddyroot.com/symfony_project/web/link1 , everything works fine . The 404 error says

The requested URL /symfony_project/symfony_project/web/app.php was not found on this server. How to make this thing work .

karyboy
  • 317
  • 1
  • 5
  • 22

1 Answers1

2

How I solved this

In the htaccess in the goddady root , write the following code

<IfModule mod_rewrite.c>
    RewriteCond %{HTTP_HOST} ^example.com$ [OR]
    RewriteCond %{HTTP_HOST} ^www.example.com$
    RewriteRule ^(.*)$ /symfony_project/web/$1
</IfModule>

Hope this might help someone ...

karyboy
  • 317
  • 1
  • 5
  • 22