Нужна помощь специалиста по написанию некоторых правил переписывания .htaccess. Вот что я пытаюсь сделать:
#) User requests Displayed to User As Actual Request to Server
1) www.example.com* example.com* example.com*
2) example.com example.com example.com/index.php
3) example.com/index.php example.com example.com/index.php
4) example.com/mypage example.com/mypage example.com/index.php?p=mypage
5) m.example.com m.example.com example.com/mobile.php
6) m.example.com/index.php m.example.com example.com/mobile.php
7) m.example.com/mobile.php m.example.com example.com/mobile.php
8) m.example.com/mypage m.example.com/mypage example.com/mobile.php?p=mypage
Вот то, чем я занимаюсь до сих пор. Он заботится о строках 1, 3 и 4. Как только я начинаю добавлять мобильные материалы, я теряюсь.
RewriteEngine On
RewriteBase /
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
RewriteCond %{THE_REQUEST} ^GET.*index\.php [NC]
RewriteRule (.*?)index\.php/*(.*) /$1$2 [R=301,L]
RewriteRule ^([a-z\-]+)$ /index.php?p=$1 [L]
Я потратил слишком много времени, пытаясь понять это, и я просто зацикливаюсь. Я продолжаю заставлять части этого работать, но затем другие части ломаются. Любая помощь будет оценена.
Спасибо!