我爱占星网 我爱占星网
首页
编程
java
php
前端
首页 编程 java php 前端

在ubuntu nginx服务器中为php启用.htaccess

My Current .htaccess File Like :

RewriteEngine on  
#RewriteBase /
RewriteRule ^/?([-A-Za-z0-9/]+)/?$ index.php?q=$1 [QSA,L]

Now it does not support Ubuntu 14.04 ngnix server. I want a URL pattern like:

abc.com/user/1

How can I achieve that?

Put this in your nginx config, nginx server not reading .htaccess files

location / { rewrite ^/?([-A-Za-z0-9/]+)/?$ /index.php?q=$1 break; }

近期文章

  • 如何使用curl在php中返回和格式化数组
  • 为什么我的对象在数组中?
  • 如何在codeigniter中将一些值从一个视图传递到另一个视图?
  • ApiRequestor.php第108行中的InvalidRequest:没有这样的客户:cus_9JHigF9SGUuVJQ
  • 使用Expires / Max-Age of Session删除cookie
  • 无法让Google OAuth2在CakePHP 3应用上运行
  • 创建函数来计算字符串中的字符数
  • 删除功能后创建撤消选项/功能
  • 将行ID设置为递增,因此没有重复项
  • 与php函数不兼容的javascript错误
  • apc_store apcu_store - 使用php缓存数据存储中的变量
  • 邻接表双向BFS算法数组越界问题
  • 请问executablenotfound是什么问题?
  • C++对象数组能否被拷贝构造函数初始化
  • JAVA怎么在容器或者标签上绘图啊?
  • 无法在codeigniter中重定向
  • 如何将SQLite连接到php ERROR
  • PHP XML Element使用@符号?
  • 将数组值从javascript传递给php
  • 在选中的复选框上显示编辑按钮

Copyright ©2022 我爱占星 All Rights Reserved.

浙ICP备2022030071号-1

部分图文来自网络,如有侵犯您的版权,请告诉我们删除

友情链接:代码精华