문제

I have a section of a website I'm building that is for the user's account pages.

The map of this bit of the site is like this:

*root*/account/details.php
*root*/account/subscriptions.php
*root*/account/options.php

I want to make it so that if a user goes to:

*root*/account

They are redirected to

*root*/account/details.php

The basic rewrite would be something like this:

RewriteRule ^account/ account/details.php [L]

However this rule means that all pages (subscriptions,options) also redirect to details which is obviously problematic.

How can I edit my rule so that it only redirects root/account to the details page, and leaves the other pages to work independently?

도움이 되었습니까?

해결책

From what I understand you want to rewrite only /account/, but not /account/XXXX. In this case try: RewriteRule ^account/$ account/details.php [L] In this case '$' identified the end of the pattern, so nothing after /account/ will be looked at.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top