doulu1907 2011-09-21 09:30 采纳率: 100%
浏览 26

too long

I used this rule on my site:

<IfModule mod_rewrite.c>
   Options +FollowSymlinks
    Options -Multiviews
    RewriteEngine on
    RewriteBase /

    RewriteCond %{HTTP_HOST} ^www.erecruitmentportal.com$
    RewriteRule ^(.*) http://erecruitmentportal.com/$1 [QSA,R=301]

    RewriteCond %{REQUEST_FILENAME} !-f
    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteRule ^([^/]+)/?$ employers/page.php?page=$1 [L]
</IfModule>

When when one logs into the website, it sets a session only in the /employers/ directory. This means that only files in that directory can access the session.

Now after rewriting urls from http://example.com/name to http://example.com/employers/page.php?page=$1,

  1. i cannot access my sessions again
  2. in the employers folder, i have a folder - logos, now i cant access logos/pic.jpg from page.php (thats the url-rewritten version). It still sees the page from the root.

I am thinking its a rewrite base issue, so how do i modify this so it will work well for this, and not affect other rules that may follow.

Thanks

EDIT

This is my session settings:

session_start();
session_set_cookie_params ( $this->sessiontimeout, $this->subdomain, $this->website, 0, 1 );
//i want the session to be available only to files in a particular folder
ini_set('session.use_only_cookies', 1);
  • 写回答

2条回答 默认 最新

  • douhuan6305 2011-09-21 11:46
    关注

    for the pictures you have to addres them as /employers/logos/pic.jpg

    as for the sessions you're using it awfully wrong.
    check permissions using some code logic, not clumsy HTTP requests.

    Let your sessions to be available everywhere but check these sessions only in them files in a particular folder

    评论

报告相同问题?

悬赏问题

  • ¥15 matlab(相关搜索:紧聚焦)
  • ¥15 基于51单片机的厨房煤气泄露检测报警系统设计
  • ¥15 路易威登官网 里边的参数逆向
  • ¥15 Arduino无法同时连接多个hx711模块,如何解决?
  • ¥50 需求一个up主付费课程
  • ¥20 模型在y分布之外的数据上预测能力不好如何解决
  • ¥15 processing提取音乐节奏
  • ¥15 gg加速器加速游戏时,提示不是x86架构
  • ¥15 python按要求编写程序
  • ¥15 Python输入字符串转化为列表排序具体见图,严格按照输入