如何从我的网站网址中删除/ 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];
}
答案 0 :(得分:3)
在RewriteEngine On
RewriteCond %{THE_REQUEST} ^.*/home
RewriteRule ^(.*)home$ http://yourwebsite.com/$1 [R=301,L]