Php 如果找到cookie,则使用.htaccess重定向

Php 如果找到cookie,则使用.htaccess重定向,php,apache,.htaccess,redirect,cookies,Php,Apache,.htaccess,Redirect,Cookies,如果存在cookie,我想使用.htaccess重定向用户 重定向需要在域(例如domain.com或domain.com/index.php)上,而不是在任何其他页面上,它们会被重定向到/index.php?option=com\u mcloud&view=dashboard 我尝试了以下方法,但无效: RewriteEngine On RewriteCond %{HTTP_COOKIE} joomla_user_state=logged_in; [NC] RewriteRule %{REQU

如果存在cookie,我想使用.htaccess重定向用户

重定向需要在域(例如domain.com或domain.com/index.php)上,而不是在任何其他页面上,它们会被重定向到/index.php?option=com\u mcloud&view=dashboard

我尝试了以下方法,但无效:

RewriteEngine On
RewriteCond %{HTTP_COOKIE} joomla_user_state=logged_in; [NC]
RewriteRule %{REQUEST_URI} /index.php?option=com_mcloud&view=dashboard [NC,L]

REQUEST_URI变量仅包含url的URI/或/index.php部分,而不包含queryString。尝试:

RewriteEngine on

RewriteCond %{HTTP_COOKIE} joomla_user_state=logged_in [NC]
RewriteCond %{REQUEST_URI} ^(/|/index.php)$ [NC]
RewriteRule ^ /index.php?option=com_mcloud&view=dashboard [L]

你可能想读一读:那不是我想要的,不客气。