How to get visitors redirected to www.yourdomain.com
Sometimes you dont have domain name but you would like to get your symfony project working. For that just place the .htaccess file from web folder to outside of the project root folder. After that edit the .htaccess file as follows.So, after entering the domain name it will automatically take to the production environment of your project..
RewriteEngine On# uncomment the following line, if you are having trouble
# getting no_script_name to work
#RewriteBase /RewriteCond %{HTTP_HOST} !^www\.domain\.com [NC]
RewriteRule ^(.*)$ http://www.domain.com/$1 [L,R=301]# we skip all files with .something
RewriteCond %{REQUEST_URI} \..+$
RewriteCond %{REQUEST_URI} !\.html$
RewriteRule .* - [L]# we check if the .html version is here (caching)
RewriteRule ^$ index.html [QSA]
RewriteRule ^([^.]+)$ $1.html [QSA]
RewriteCond %{REQUEST_FILENAME} !-f# no, so we redirect to our front web controller
RewriteRule ^(.*)$ web/index.php [QSA,L]
Enjoy It...! Have a fun... :)
6 comments:
what is .htaccess in symfony?
Hi Kannan, good blog. Please keep adding more Symfony Tips and help the Open Source Community.
hai.. How to save the date input as a null value while without giving date input
When forming the table you should give param default as NULL. So date field will be save as NULL when u not choosing the date. :)
how to get date format as dd-mm-yy in object_input_date_tag
Post a Comment