Tôi không thể hiểu cách chuyển hướng đến thư mục mẹ trong trường hợp này: Tôi có thư mục gốc có tệp .htaccess, trong đó rewriteEngine đang bật. Trong thư mục này tôi có một file rootFile.php. Ngoài ra, trong thư mục này tôi có một thư mục "diễn đàn", với một tập tin .htaccess trong đó.htaccess RewriteRule chuyển hướng đến thư mục mẹ?
Khi có yêu cầu "forum.mySite.com/rootFile.php", tôi cần chuyển hướng nó tới "mySite.com/rootFile.php" có nghĩa là tôi cần chuyển hướng yêu cầu tới thư mục chính.
/forum/.htaccess:
RewriteEngine on
RewriteBase /forum/
RewriteRule ^sitemap /forum/map.php [L]
...
Tôi cố gắng để:
RewriteEngine on
RewriteBase /forum/
RewriteRule ^rootFileName ../rootFile.php [L]
\# or so RewriteRule ^rootFileName /rootFile.php [L]
\# or so RewriteRule ^rootFileName rootFile.php [L]
RewriteRule ^sitemap /forum/map.php [L]
Cũng cố gắng này một:
RewriteEngine on
RewriteBase/
RewriteRule ^rootFileName ../rootFile.php [L]
\# or so RewriteRule ^rootFileName /rootFile.php [L]
\# or so RewriteRule ^rootFileName rootFile.php [L]
RewriteBase /forum/
RewriteRule ^sitemap /forum/map.php [L]
Và nó luôn luôn chuyển hướng từ/forum/rootFileName để/forum/rootFile, nhưng không bao giờ đến/rootFile.
Lỗi của tôi ở đâu?
nơi nào con đường '/ hello/world' cần để trỏ đến? – MrIsaacs