从URL';中删除index.php后,会话随机丢失;s

从URL';中删除index.php后,会话随机丢失;s,php,apache,.htaccess,mod-rewrite,joomla3.0,Php,Apache,.htaccess,Mod Rewrite,Joomla3.0,我在joomshopping上有一个电子商务应用程序(即joomla的电子商务扩展),我已经从URL中删除了index.php。现在,购物车会话将在任何步骤自动随机销毁。 为了删除index.php,我从joomla admin启用了搜索引擎友好的URL和URL重写。我正在使用ubuntu14.04并将.htaccess文件放在根目录中。 我的应用程序被放入子目录名中 我对SEF URL做了以下更改:- 1) .htaccess代码 ## # @package Joomla # @copy

我在joomshopping上有一个电子商务应用程序(即joomla的电子商务扩展),我已经从URL中删除了index.php。现在,购物车会话将在任何步骤自动随机销毁。
为了删除index.php,我从joomla admin启用了搜索引擎友好的URL和URL重写。我正在使用ubuntu14.04并将.htaccess文件放在根目录中。

我的应用程序被放入子目录名中

我对SEF URL做了以下更改:-

1) .htaccess代码

##
# @package    Joomla
# @copyright  Copyright (C) 2005 - 2014 Open Source Matters. All rights reserved.
# @license    GNU General Public License version 2 or later; see LICENSE.txt
# READ THIS COMPLETELY IF YOU CHOOSE TO USE THIS FILE!
# The line just below this section: 'Options +FollowSymLinks' may cause problems
# with some server configurations.  It is required for use of mod_rewrite, but may already
# be set by your server administrator in a way that dissallows changing it in
# your .htaccess file.  If using it causes your server to error out, comment it out (add # to
# beginning of line), reload your site in your browser and test your sef url's.  If they work,
# it has been set by your server administrator and you do not need it set here.
## Can be commented out if causes errors, see notes above.
#Options +FollowSymLinks
## Mod_rewrite in use.

<FilesMatch "\\.(html|htm|php|js)$">
FileETag None
Header unset ETag
Header set Cache-Control "max-age=0, no-cache, no-store, must-revalidate"
Header set Pragma "no-cache"
</FilesMatch>

RewriteEngine On

#RewriteCond %{HTTP_HOST} ^example.com/demoinstance [NC]
#RewriteRule ^(.*)$ http://www.example.com/demoinstance/$1 [L,R=301,NC]
## Begin - Rewrite rules to block out some common exploits.
# If you experience problems on your site block out the operations listed below
# This attempts to block the most common type of exploit `attempts` to Joomla!
# Block out any script trying to base64_encode data within the URL.

RewriteCond %{QUERY_STRING} base64_encode[^(]*\([^)]*\) [OR]
# Block out any script that includes a <script> tag in URL.

RewriteCond %{QUERY_STRING} (<|%3C)([^s]*s)+cript.*(>|%3E) [NC,OR]
# Block out any script trying to set a PHP GLOBALS variable via URL.

RewriteCond %{QUERY_STRING} GLOBALS(=|\[|\%[0-9A-Z]{0,2}) [OR]
# Block out any script trying to modify a _REQUEST variable via URL.

RewriteCond %{QUERY_STRING} _REQUEST(=|\[|\%[0-9A-Z]{0,2})
# Return 403 Forbidden header and show the content of the root homepage

RewriteRule .* index.php [F]
## End - Rewrite rules to block out some common exploits.
## Begin - Custom redirects
# If you need to redirect some pages, or set a canonical non-www to
# www redirect (or vice versa), place that code here. Ensure those
# redirects use the correct RewriteRule syntax and the [R=301,L] flags.
## End - Custom redirects
# Uncomment following line if your webserver's URL
# is not directly related to physical file paths.
# Update Your Joomla! Directory (just / for root).

RewriteBase /demoinstance/
## Begin - Joomla! core SEF Section.

RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
# If the requested path and file is not /index.php and the request
# has not already been internally rewritten to the index.php script

RewriteCond %{REQUEST_URI} !^/index\.php
# and the requested path and file doesn't directly match a physical file

RewriteCond %{REQUEST_FILENAME} !-f
# and the requested path and file doesn't directly match a physical folder

RewriteCond %{REQUEST_FILENAME} !-d
# internally rewrite the request to the index.php script

RewriteRule .* index.php [L]
##End - Joomla! core SEF Section.
5) 小提琴手回答:-没有404/302错误。303/403/202响应即将到来

请帮帮我。我在过去20天里一直面临这个问题,但还没有找到任何解决办法


提前感谢。

只是一个提示,会话是由您的php应用程序生成和维护的,您在查看apache配置时不会发现任何有用的内容。另一个技巧是,您可以使用一个
FallbackResource/index.php
line删除最后4条重写指令。这个问题是在从URL中删除index.php之后出现的,否则会话可以完美地使用index.php。请帮助:(至少尝试我提到的FallBackResource。index.php不会出现在URL中,但它会加载,因为默认加载页面也应该使用DirectoryIndex.php。两种方法都尝试一下,删除您最近的4条重写规则,并分享您的发现。我已经删除了`RewriteRule.-[E=HTTP\U授权:%{HTTP:AUTHORIZATION}]RewriteCond%{REQUEST_URI}!^/index\.php RewriteCond%{REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-重写规则。*index.php[L]`and added
FallbackResource/index.php
未找到结果404。在.htaccess中使用
FallbackResource/index.php
后,会话再次被清除。只是一个提示,会话是由您的php应用程序生成和维护的,您在查看apache配置时不会发现任何有用的内容。另一个提示,您可以使用单个
FallbackResource/index.php
line移动最后4条重写指令此问题是在从URL中删除index.php之后出现的,否则会话将与index.php完美配合。请帮助:(至少试一下我提到的FallBackResource。index.php不会出现在URL中,但它会加载,因为默认加载页面也应该使用DirectoryIndex.php。试一下这两种方法,删除最后4条重写规则,并分享您的发现。我已经删除了'RewriteRule.*-[E=HTTP_AUTHORIZATION:%{HTTP:AUTHORIZATION}]RewriteCond%{REQUEST_URI}!^/index\.php RewriteCond%{REQUEST_FILENAME}!-f RewriteCond%{REQUEST_FILENAME}!-d RewriteRule.*index.php[L]`并添加了
FallbackResource/index.php
未找到结果404。在.htaccess中使用
FallbackResource/index.php
后再次清除会话
<Directory '/var/www/html'>
AllowOverride All
</Directory>
session.save_path   /var/www/html/example/session   /var/www/html/demoinstance/session