问题描述
我的重写规则不起作用,我检查了许多站点,但找不到任何内容。假设重定向到https://www.example.com,但仅重定向到https://example.com。其次,我的重写规则不起作用,因为当我尝试访问它们时,我不断得到404。例如example.com/user/profile.PHP?username=用户名假定为example.com/users/Username
# copYRIGHT 2020 BLOX CORPORATION
RewriteEngine On
RewriteCond %{HTTPS} off [OR]
RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteCond %{HTTP_HOST} ^(.*)$ [NC]
RewriteRule (.*) https://www.%1/$1 [R=301,L
ErrorDocument 403 /error/?errorcode=403;
ErrorDocument 404 /error/?errorcode=404;
ErrorDocument 500 /error/?errorcode=500;
RewriteRule ^/account/verify$ /account/verify.PHP;
RewriteRule ^/account/forgot-password/$ /account/forgot.PHP;
RewriteRule ^/account/logout/$ /account/logout.PHP;
RewriteRule ^/account/inBox/$ /account/inBox.PHP;
RewriteRule ^/account/friends/$ /account/friends.PHP;
RewriteRule ^/account/Trades/$ /account/Trades.PHP;
RewriteRule ^/account/character/process$ /account/character-process.PHP;
RewriteRule ^/account/character/$ /account/character.PHP;
RewriteRule ^/account/inBox/chats/api/(.*)$ /account/inBox/ChatAPI.PHP?id=$1;
RewriteRule ^/account/inBox/chats/(.*)$ /account/inBox/chat.PHP?id=$1;
RewriteRule ^/account/settings/process/$ /account/edit-process.PHP;
RewriteRule ^/account/settings/blocked/$ /account/edit-blocked.PHP;
RewriteRule ^/account/settings/(.*)/$ /account/settings/index.PHP?tab=$1;
RewriteRule ^/account/settings/$ /account/edit.PHP;
RewriteRule ^/account/message/(.*)/$ /account/message.PHP?id=$1;
RewriteRule ^/account/discord-verify$ /account/discord-verify.PHP;
RewriteRule ^/games/(.*)/(.*)/$ /games/viewGame.PHP?GameId=$1&SEOName=$2;
RewriteRule ^/games/edit/(.*)$ /games/editGame.PHP?GameId=$1;
RewriteRule ^/Trade/view/(.*)/$ /account/view_Trade.PHP?id=$1;
RewriteRule ^/Trade/process/$ /Trade/process.PHP;
RewriteRule ^/user/(.*)/friends/$ /user/friends.PHP?username=$1;
RewriteRule ^/user/(.*)/groups/$ /user/groups.PHP?username=$1;
RewriteRule ^/user/suspended/$ /user/suspended.PHP;
RewriteRule ^/user/Trade/inventory/$ /Trade/inventory.PHP;
RewriteRule ^/user/Trade/(.*)/$ /Trade/index.PHP?Username=$1;
RewriteRule ^/users/(.*)/message/$ /user/sendmessage.PHP?username=$1;
RewriteRule ^/users/(.*)/backpack/fetch/(.*)/(.*)/$ /user/UserInventoryJSON.PHP?u=$1&t=$2&p=$3;
RewriteRule ^/users/(.*)/backpack/fetch/(.*)/$ /user/UserInventoryJSON.PHP?u=$1&t=$2;
RewriteRule ^/users/(.*)/backpack/$ /user/userInventory.PHP?u=$1;
RewriteRule ^/users/(.*)/$ /user/profile.PHP?username=$1;
RewriteRule ^/forum/topic/(.*)/(.*)/$ /forum/topic.PHP?id=$1&page=$2;
RewriteRule ^/forum/topic/(.*)/$ /forum/topic.PHP?id=$1;
RewriteRule ^/forum/thread/(.*)/(.*)/$ /forum/thread.PHP?id=$1&page=$2;
RewriteRule ^/forum/thread/(.*)/$ /forum/thread.PHP?id=$1;
RewriteRule ^/forum/reply/(.*)/$ /forum/reply.PHP?id=$1;
RewriteRule ^/forum/new/(.*)/$ /forum/new.PHP?id=$1;
RewriteRule ^/forum/movethread/(.*)/$ /forum/move.PHP?id=$1;
RewriteRule ^/forum/bookmarks/$ /forum/bookmarks.PHP;
RewriteRule ^/forum/my-posts/$ /forum/my-posts.PHP;
RewriteRule ^/forum/drafts/$ /forum/drafts.PHP;
RewriteRule ^/forum/draft/(.*)/$ /forum/view-draft.PHP?id=$1;
RewriteRule ^/forum/search/$ /forum/search.PHP;
RewriteRule ^/store/edit/(.*)/$ /store/edit.PHP?id=$1;
RewriteRule ^/store/view/(.*)/$ /store/item.PHP?id=$1;
RewriteRule ^/store/search/(.*)/(.*)/(.*)/$ /store/fetch.PHP?sort=$1&query=$2&page=$3;
RewriteRule ^/store/fetch/(.*)/(.*)/$ /store/fetch.PHP?sort=$1&page=$2;
RewriteRule ^/store/fetch/(.*)/$ /store/fetch.PHP?sort=$1;
RewriteRule ^/sign-up/forgot-old-account-pass/$ /sign-up/forgot.PHP;
RewriteRule ^/groups/(.*)/create/shirt/$ /groups/create/shirt.PHP?id=$1;
RewriteRule ^/groups/(.*)/create/pants/$ /groups/create/pants.PHP?id=$1;
RewriteRule ^/groups/(.*)/get-members/(.*)/(.*)/$ /groups/get_members.PHP?id=$1&rank=$2&page=$3;
RewriteRule ^/groups/(.*)/get-divisions/(.*)/$ /groups/get_divisions.PHP?id=$1&page=$2;
RewriteRule ^/groups/(.*)/get-store/(.*)/$ /groups/get_store.PHP?id=$1&page=$2;
RewriteRule ^/groups/(.*)/settings/members/(.*)/(.*)/$ /groups/settings_members.PHP?id=$1&rank=$2&page=$3;
RewriteRule ^/groups/(.*)/settings/$ /groups/settings.PHP?id=$1;
RewriteRule ^/groups/(.*)/(.*)/$ /groups/view.PHP?id=$1&SEO=$2;
RewriteRule ^/upgrade/checkout$ /upgrade/checkout.PHP;
RewriteRule ^/upgrade/bits$ /upgrade/bits.PHP;
RewriteRule ^/upgrade/credits$ /upgrade/credits.PHP;
RewriteRule ^/search/fetch/(.*)$ /search/fetch.PHP?q=$1;
RewriteRule ^/search/category/(.*)/(.*)/(.*)$ /search/fetchCategory.PHP?c=$1&&p=$2&q=$3;
RewriteRule ^/inBox$ /inBox/index.PHP;
RewriteRule ^/inBox/user/(.*)$ /inBox/chat.PHP?type=user&username=$1;
RewriteRule ^/inBox/group/(.*)$ /inBox/chat.PHP?type=group&groupId=$1;
RewriteRule ^/inBox/notification/(.*)$ /inBox/chat.PHP?type=notification¬ificationId=$1;
RewriteRule ^/inBox/group-invite/(.*)$ /inBox/acceptGroupInvite.PHP?code=$1;
RewriteRule ^/inBox/view-notification/(.*)$ /inBox/viewNotification.PHP?id=$1;
RewriteRule ^/api/user/get-notifications$ /API/user/GetAllNotifications.PHP;
RewriteRule ^/api/user/get-unread-notifications$ /API/user/GetUnreadNotifications.PHP;
RewriteRule ^/api/chats/get-chats/(.*)/(.*)/(.*)$ /API/chats/GetChats.PHP?type=$1&id=$2&p=$3;
RewriteRule ^/api/chats/get-recent-chats$ /API/chats/GetRecentChats.PHP;
RewriteRule ^/api/chats/get-chats-summary$ /API/chats/GetChatsSummary.PHP;
RewriteRule ^/api/chats/get-group-chats-summary$ /API/chats/GetGroupChatsSummary.PHP;
RewriteRule ^/api/chats/get-notifications-summary$ /API/chats/GetNotificationsSummary.PHP;
RewriteRule ^/api/chats/check-profanity$ /API/chats/CheckProfanity.PHP;
RewriteRule ^/api/chats/group/edit-group$ /API/chats/group/EditGroup.PHP;
RewriteRule ^/api/chats/group/manage-members$ /API/chats/group/ManageGroupMembers.PHP;
RewriteRule ^/api/chats/group/get-members$ /API/chats/group/GetMembers.PHP;
RewriteRule ^/api(.*)$ /API$1;
解决方法
暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!
如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。
小编邮箱:dio#foxmail.com (将#修改为@)