如何在使用mod_rewrite时摆脱循环重定向

时间:2017-08-12 18:42:57

标签: apache mod-rewrite

我试图在CNC链接中使用get参数重新制作引用,转换本身也可以工作,但是当我点击链接时,页面会加载很长时间,最后会显示 该页面不可用 www.by网站重定向次数太多了。 删除cookies .. ERR_TOO_MANY_REDIRECTS

这是我使用的代码

参考类型

sitedotcom / product.php文章= PP454&安培;名称= LM78H05K- [TO-3]

转化为 sitedotcom / PP454 / LM78H05K- [TO-3]的.html

以下是如何在htpacces中执行此操作:

#ifndef HELPER_H
#define HELPER_H

#include <ctime>
#include <string>
#include <sstream>
#include <fstream>

namespace Helper
{
    template <class T>

    std::string ToString(const T &);

    struct DateTime
     {
         DateTime()
         {
             time_t ms;
             time (&ms);

             struct tm *info = localtime(&ms);

             D = info->tm_mday;
             m = info->tm_mon + 1;
             y = 1900 + info->tm_year;
             M = info->tm_min;
             H = info->tm_hour;
             S = info->tm_sec;
         }


         DateTime(int D,int m,int y,int M,int H,int S):D(D),m(m),y(y),H(H),M(M),S(S) {}
         DateTime(int D,int m,int y) : D(D) , y(y) , m(m) , H(0) , M(0) , S(0) {}

         DateTime Now() const
         {
             return DateTime();
         }

         int D,m,y,H,M,S;

         std::string GetDateString() const
         {
             return std::string(D < 10 ? "0" : "") + ToString(D) +
                    std::string(m <10 ? ".0" : ".") + ToString(m) + "." +
                    ToString(y);
         }

         std::string GetTimeString(const std::string &sep = ":") const
         {
             return std::string(H< 10 ? "0" : "") + ToString(H) + sep +
                    std::string(M< 10 ? "0" : "") + ToString(M) + sep +
                    std::string(S<10 ? sep : "") + ToString(S);
         }

         std::string GetDateTimeString(const std::string &sep = ":") const
         {
             return GetDateString() + " " + GetTimeString(sep);

         }

     };
     template<class T>

     std::string ToString(const T &e)
     {
         std::ostringstream s;
         s << e;
         return s.str();
     }

     void WriteAppLog(const std::string &s)
     {
         std::ofstream file("AppLog.txt", std::ios::app);
         file << "[" << Helper::DateTime.GetDateTimeString() << "[" << "\n" << s << std::endl << "\n";
         file.close();

     }
}

#endif // HELPER_H

提示在哪里挖掘,以便没有循环重定向

0 个答案:

没有答案
相关问题