.htaccess 다시 쓰기 규칙을 사용하고 있습니다. 내 규칙을 모두 완벽하게 작동하는.htaccess mod 다시 쓰기 규칙을 사용하는 경우 PHP 쿠키를 사용할 수 없습니다.
Options -MultiViews
RewriteEngine on
RewriteRule ^Login login.php [NC,L]
RewriteRule ^Register register.php [NC,L]
RewriteRule ^Posts/([0-9a-zA-Z_-]+)/([0-9a-zA-Z_-]+) posts.php?category=$1&subcategory=$2 [NC,L]
하지만 문제는 여기에 있습니다 : 내가 액세스하는 경우
<a href='Login'>Login</a> from website home page it is redirecting to login.php that is perfectly working
하지만 난
<a href='Login'>Login</a> from website posts page it is redirecting to Posts/login.php which is incorrect. It should redirect to login.php only.
이 난을 해결하기 위해 액세스하는 경우 로그인 버튼에 직접 페이지를
으로 사용함3210<a href='http://www.mywebsite.com/Login'>Login</a>
완벽하게 작동하지만 문제는 모든 페이지의 쿠키에 도시 이름을 유지해야하므로 사용할 수없는 쿠키입니다.
내 웹 사이트의 링크를 확인 : 내가 홈 페이지에있어 같은 http://fidfeet.com/Login, http://fidfeet.com/Categories/Login
먼저 하나가 작동,하지만 난이 카테고리 페이지에있어 둘째가 작동하지 않습니다.
쿠키를 사용하지 않더라도 세션에 도시 이름을 등록 할 수 있습니다. https://www.w3schools.com/php/php_sessions.asp – danielarend