从网站网址中删除主页

时间:2016-11-08 21:28:13

标签: .htaccess codeigniter

如何从我的网站网址中删除/ home,以便我的网站只能通过mywebsite.com和mywebsite.com/home访问,重定向到mywebsite.com

public static Activity getActivity() {
    final Activity[] currentActivity = new Activity[1];
    Espresso.onView(AllOf.allOf(ViewMatchers.withId(android.R.id.content), isDisplayed())).perform(new ViewAction() {
        @Override
        public Matcher<View> getConstraints() {
            return isAssignableFrom(View.class);
        }

        @Override
        public String getDescription() {
            return "getting text from a TextView";
        }

        @Override
        public void perform(UiController uiController, View view) {
            if (view.getContext() instanceof Activity) {
                Activity activity1 = ((Activity)view.getContext());
                currentActivity[0] = activity1;
            }
        }
    });
    return currentActivity[0];
}

1 个答案:

答案 0 :(得分:3)

RewriteEngine On

下面添加此项
RewriteCond %{THE_REQUEST} ^.*/home
RewriteRule ^(.*)home$ http://yourwebsite.com/$1 [R=301,L]