我有这个htaccess,它从stjernekaffe重定向用户。Dk到目录
RewriteEngine on
RewriteCond %{REQUEST_URI} ^/$
RewriteRule (.*) http://stjernekaffe.dk/am/signup/index/c/QBYEYjDr [R=301,L]
我需要它在输入stjernekaffe时指向目录。
显示目录/文件,而不重定向路径/URL。这有可能实现吗?
我有这个htaccess文件在我的/am/文件夹:
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /am
RewriteRule ^public public.php [L]
RewriteRule ^js.php js.php [L]
RewriteRule !'.(js|ico|gif|jpg|png|css|swf|csv|html)$ index.php
</IfModule>
我已经尝试过这个(但它就像/am -htaccess文件在父htaccess中做错了)
Options +FollowSymLinks -MultiViews
RewriteEngine On
RewriteBase /
RewriteRule ^$ /am/signup/index/c/QBYEYjDr [L]
如果您不想要外部重定向(即避免在浏览器中更改URL),那么请确保:
- 在rewriterrule 中不使用
- 不要在目标URL 中使用以
R
标志http
开头的完整URL按照上面的建议修改你在DOCUMENT_ROOT/中的代码。htaccess:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /
RewriteRule ^$ /am/signup/index/c/QBYEYjDr [L]
更改DOCUMENT_ROOT/am/中的代码。htaccess:
Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /am/
RewriteRule ^public/?$ public.php [L,NC]
RewriteCond %{ENV:REDIRECT_STATUS} !200
RewriteRule !'.(js|ico|gif|jpg|png|css|swf|csv|html)$ index.php [L,NC]