Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ApplicationUrl и HttpUrl #237

Open
DeryabinSergey opened this issue May 6, 2016 · 6 comments
Open

ApplicationUrl и HttpUrl #237

DeryabinSergey opened this issue May 6, 2016 · 6 comments

Comments

@DeryabinSergey
Copy link
Contributor

Расскажите, пожалуйста, в двух словах - кто как использует. И как задумывалось. Может кто-то даже файлик прикрепит из проекта своего.

Хочу уйти от написания rewrite в nginx - что бы и разбор и генерация путей были в одном месте. Такое возможно?

@dewid1985
Copy link

Есть такое решение!
https://github.com/dewid1985/onphp-framework
Я добавил утилиты https://github.com/AlexeyDsov/onPHPUtils
Если пользуетесь основным репозиторием то брать у Алексея.
Подключается примерно так
https://gist.github.com/dewid1985/bff44105caf2575c0b78
Роутинг
https://gist.github.com/dewid1985/0fe0b29f4709c523d5c5
Index.php
https://gist.github.com/dewid1985/a66a9ec0cc5ffa76dcd2
Если вы конечно.
Да и конечно наследование конроллера должно быть от MethodMappedController

@dewid1985
Copy link

dewid1985 commented May 6, 2016

RewriteEngine on
Options +FollowSymLinks
RewriteCond $1 !^(index.php|js|bower_components|bootstrap|dist|css|fonts|noty|images|robots.txt)
RewriteRule ^(.*)$ /index.php/$1 [L]

Да если пользуетесь apache вот вам .htaccess

Для nginx хватает стандартного решения из коробки с php-fpm

@DeryabinSergey
Copy link
Contributor Author

Спасибо, пока с планшета смотрю. Вечером сяду код покурю

@dewid1985
Copy link

Если что стучитесь https://www.facebook.com/sdewid

@DeryabinSergey
Copy link
Contributor Author

Насчёт стандартного решения для nginx не понял...

@dewid1985
Copy link

dewid1985 commented May 11, 2016

Извиняюсь за долгий ответ, выходные были!!!

location ~ .php$ {
fastcgi_pass unix:/var/run/php-fpm.socket;
fastcgi_index index.php;
fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
include fastcgi_params;
}

location / {
root /usr/home/www/public_html/example.com/;
index index.html index.htm index.php;
try_files $uri $uri/ /index.php?$query_string;
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants