1

I'm working on my first symfony 4 project and i would like to upload it on my online server. My goal is to have it online on my domain to test it before a preview with my client.

I tried to put my files on the www folder (by ftp) and add a .htaccess in the main repository with :

<IfModule mod_rewrite.c>RewriteEngine On

# remove "www" from URI
RewriteCond %{HTTP_HOST} ^devfuzz\.(.+) [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]

# force HTTPS
RewriteCond %{HTTPS} !on
RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

# use public as starting point
RewriteRule ^$ public/ [L]
RewriteRule (.*) public/$1 [L]</IfModule>

And i added a .htaccess in public with :

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^ index.php [QSA,L]

I tried so many thing found on many forum but i have always the same with when i try to go on my website :

website view

How can i change this view to have a normal navigation like i had with : php bin/console server:run in local

6
  • 1
    which webserver (apache, nginx) in which version and which php (pfm, cgi etc.) in which version are installed on your "online server"? Commented Mar 13, 2019 at 11:29
  • My ovh server is on php 7.2 but i don't know my webserver version (and i don't really know if i have one installed) Commented Mar 13, 2019 at 12:41
  • so, then this might be your issue Commented Mar 13, 2019 at 13:22
  • That was my apache configuration. Sorry for the lost of time, i'm stuck in hell until the end of this project =P Commented Mar 13, 2019 at 15:43
  • You don't need to create the .htaccess yourself, use apache-pack. My answer here may help: stackoverflow.com/questions/47949952/… Commented Mar 13, 2019 at 17:54

1 Answer 1

2

Try to change your code with this one :

  # remove "www" from URI
  RewriteCond %{HTTP_HOST} ^www\.(.+) [NC]
  RewriteRule ^ http://%1%{REQUEST_URI} [L,R=301]

You don't need to remove the www in this part of code, this code will do it for you so do NOT change it :)

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.