小编Ste*_*n G的帖子

将文件移动到新文件夹,保留Git历史记录

我希望移动一个文件夹,使其驻留在另一个文件夹中.

目前:/ folder1,移动到/ holder/folder1,例如.

在我的家用机器(Mac)和git上执行此操作的最简单方法是什么,以确保该文件夹中文件的所有历史记录都保留在github上.

对不起,对于新问题.我只有一个非常基本的git工作知识,并希望尽可能简单.

谢谢!

git macos command-line

13
推荐指数
1
解决办法
6971
查看次数

Apache ReWriteEngine因内部重定向过多而导致500内部服务器错误...为什么?

我正在尝试在我的本地开发机器上实现一个新的ReWrite规则.我已经设置了13条规则,并且一切正常(即使是在撰写本文时).但是,由于某种原因,最新的一个给我带来了500个内部服务器错误.

重写规则是:

RewriteRule stuff/public_html/vault/mystuff/view/(.*) /stuff/public_html/vault/mystuff/view/index.php?stuff=$1

RewriteRule stuff/public_html/vault/mystuff/view/(.*)/ /stuff/public_html/vault/mystuff/view/index.php?stuff=$1
Run Code Online (Sandbox Code Playgroud)

检查了我的apache日志,得到了这个:

[Thu Jan 13 22:07:43 2011] [error] [client ::1] mod_rewrite: maximum number of internal redirects reached. Assuming configuration error. Use 'RewriteOptions MaxRedirects' to increase the limit if neccessary., referer: http://localhost:8888/stuff/public_html/vault/mystuff/all/index.php?curr=7
Run Code Online (Sandbox Code Playgroud)

在脚本上我试图重定向到view/index.php?stuff = $ 1,没有任何东西甚至可以远程类似于任何类型的重定向.我确实在登陆脚本的顶部调用了一个非常非常基本的会话验证程序,如下所示:

//Start session
 session_start();

 //Check whether the session variable SESS_MEMBER_ID is present or not
 if(!isset($_SESSION['SESS_MEMBER_ID']) || (trim($_SESSION['SESS_MEMBER_ID']) == '')) {
  header("location: ".$root_http."");
  exit();
 }
Run Code Online (Sandbox Code Playgroud)

但是,当我直接访问页面时,它会按预期运行,并且没有重定向.我的所有其他ReWrite规则及其相应的登录页面设置方式完全相同.

这让我大吃一惊.任何帮助,请!?

根据Marc BI的建议启用了RewriteLog,并想出了这个:

:: 1 - - [13/Jan/2011:23:00:09 - 0500] [localhost/sid#807df8] [摆脱#941b38/initial/redir#10](2)[per-dir/Users/stepheng/Development /]重写stuff/public_html/vault/mystuff/view/index.php - …

php apache mod-rewrite redirect

1
推荐指数
1
解决办法
2896
查看次数

使用PHP在MySQL中存储用户选择的有效方法?

我无法找出存储用户想要查看的信息的最佳方式.我为无法找到一个简单的方法来解释我的问题而道歉,但这里有(例如,水果是为了这个):

假设我的用户可以选择跟踪冰箱中的以下水果:

苹果,橘子,葡萄,梨

数据库已经设置了一个名为'fruits'的表,其中Apples是id_fruit = 1,Oranges是id_fruit = 2,等等.

就像我说的所有用户都有OPTION来跟踪这些水果,但是......我目前无法找到一种简单的方法来存储用户选择他们想跟踪的WHICH水果.如果用户1不喜欢苹果,他可以进入他的设置,取消选中苹果,不再让苹果出现在他的仪表板中.

我能想到存储这些信息的唯一方法是创建一个包含字段user_id,apples,orange,grapes,pears的表.然后为结果存储user_id和Yes/No或0/1.

如果我想要添加更多水果或其他什么,这会引起严重的悲痛.

使用PHP在MySQL中存储此信息的最佳方法是什么?我将如何检索该信息.

用户登录,检查他想要查看哪些水果的DB,并仅显示他选择的水果.

任何帮助将不胜感激.

php mysql

1
推荐指数
1
解决办法
383
查看次数

标签 统计

php ×2

apache ×1

command-line ×1

git ×1

macos ×1

mod-rewrite ×1

mysql ×1

redirect ×1