DevGroup-ru / dotplant2

E-Commerce CMS - Yii Framework 2 (yii2, shop)
http://dotplant.ru/
Other
640 stars 253 forks source link

Url and file path #139

Closed azerturk closed 9 years ago

azerturk commented 9 years ago

After installation css file like /demo/css, and url like /cart, /add not found. Because of my root is localhost:1234 but it should be localhost:1234/dotplant/application/web. I try some solutions but why url and file path like this after installation? I only apply php install.php. Everything is ok except this.

bethrezen commented 9 years ago

Change your document root to your_path_to_dotplant/application/web It is unsafe to make docroot upper-level then web folder. Also check configuration variable (Config table where path='core.serverName') - if your docroot is web folder then it should be localhost:1234

gabriele-carbonai commented 9 years ago

i have the same problem.. how can i do? i try to understand, but how can i change my document root?

bethrezen commented 9 years ago

@gomonkey in your apache configs find your virtualhost and append "application/web/" to it's DocumentRoot. After that restart web-server

gabriele-carbonai commented 9 years ago

yes i did it, I tryed to create virtual host and working, i tryed with apache conf and working but the urls still are wrong. For admin no problem this is mine config.... im wrong somewhere? Alias /application "/Applications/MAMP/htdocs/application/web/"

<Directory "/Applications/MAMP/htdocs/application/web/">
    # use mod_rewrite for pretty URL support
    RewriteEngine on
    # If a directory or a file exists, use the request directly
    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    # Otherwise forward the request to index.php
    RewriteRule . index.php
</Directory>

note: withouth alias not working

bethrezen commented 9 years ago

@gomonkey paste your full config to pastebin please

gabriele-carbonai commented 9 years ago

thanks... is here http://pastebin.com/vEQtQtDE

bethrezen commented 9 years ago

@gomonkey try this config http://pastebin.com/gvWpxXzh

gabriele-carbonai commented 9 years ago

nothing, i will try to put inside a real server :) thanks for your availability

gabriele-carbonai commented 9 years ago

I put everything in the server and the path is localhost... how is it possible?

bethrezen commented 9 years ago

@gomonkey There's an option in core module - serverName. It can be set in http://your_server/config/backend/index or by manual editing of config/web-configurables and config/configurables-state/core.php

TheBurningRed commented 8 years ago

Worked for me! Damn, I've lost so many time trying to fix my local webserver, cuz by default XAMPP may also redirect you to /localhost when virtualhosts are not set properly. Dotplant's variable serverName is also set to localhost by default.

daniepusb commented 7 years ago

@TheBurningRed About Dotplant2, instructions said: Your virtual server DocumentRoot directory should point to application/web. How can I do that? how can I set my documentRoot or set a vhost to do exactly that?

bethrezen commented 7 years ago

@daniepusb in your web server config. https://httpd.apache.org/docs/2.4/mod/core.html#documentroot

daniepusb commented 7 years ago

@bethrezen Sorry, do not work for me. I am using wamp64 on WINDOWS. my config file is in C:\wamp64\bin\apache\apache2.4.18\conf\httpd.conf I set DocumentRoot like this: DocumentRoot "c:/wamp64/www/dotplant2-master/application/web" <Directory "c:/wamp64/www/dotplant2-master/application/web"> ...

I stop and Start all services again and again, still not working Any idea?

bethrezen commented 7 years ago

@daniepusb check if you are requesting the same domain name as it is configured in serverName of dotplant2 configs. Or give more information on what is exactly not working.

daniepusb commented 7 years ago

@bethrezen I am following the instruction from here: https://github.com/DevGroup-ru/dotplant2 I am using Windows and wamp64

I finish to install composer dependencies and next step is set the documentRoot at "application/web." There is not a file ./installer on application folder, the instruction said "Then run ./installer in application folder."

dotplant

bethrezen commented 7 years ago

Please show full browser screenshot including your address bar

daniepusb commented 7 years ago

@bethrezen Also put in here my httpd.conf file

httpd.txt

dotplant

bethrezen commented 7 years ago

Well. I suggest you learn how webservers and serverside languages work at first. After that start learning PHP and CMS systems :-) The virtualhost section in your apache config is commented out - your changes were not applied. If you are using wamp stack - your virtualhosts configs may be in another files. The goal is to achieve accessing the cms from http://localhost/ and not http://localhost/application/web/