我有一个简单的问题,在重定向的网站文件夹链接。我有一个主域,假设ABC.COM和我有另一个子域XYZ.com。我在ABC.com的文档根文件夹中有XYZ.com,文件夹名是othersite。一切都很完美,但是当我在浏览器中手动输入,比如www.XYZ.com/hero,它需要一个目录,但是浏览器中的url会发生变化,显示为www.XYZ.com/othersite/hero。我不确定为什么它会这样做,但当我键入www.XYZ.com/hero/时,它可以工作,也就是说,在结尾加上/。
下面是我在abc.com htaccess中的主htaccess中的内容
RewriteEngine On
所以我使用的是Kohana,如果你知道它是很有用的,但不需要它来帮助我。
我有以下mod_rewrite规则:
# Allow any files or directories that exist to be displayed directly
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !^/store/.*$
# Rewrite all other URLs to index.php/URL
RewriteRule .* index
我正在构建一个以PHP作为API服务器的angular应用程序。我想从angular post方法中清除尾随的/index.php。我尝试使用如下的.htaccess文件
######### Begin - RewriteEngine enabled
RewriteEngine On
########## End - RewriteEngine enabled
########## remove index.php from the end of URI
RewriteCond %{THE_REQUEST} /index\.php [NC]
R
我正在制定一条.htaccess规则。
我想删除所有网址的尾部斜杠。
For ex:-
http://www.test.com/admin Working fine
But
http://www.test.com/admin/ Gives me error.
如果我像一样运行URL,那么它会自动重定向到
我已经把下面的代码放在htaccess文件中。
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !(.*)/$
我在URL末尾的尾部斜杠有问题。我在网上检查URL重定向,结果显示我的页面上有太多的重定向,所以我需要减少这些重定向我的链接有以下结果
https://example.com/xyz/pqr
302 Found
https://example.com/xyz/pqr/
302 Found
https://example.com/xyz/pqr//
302 Found
https://example.com/xyz/pqr///
302 Found
https://example.com/xyz/pqr////
302 Found
https://example.com/xyz/pqr/////
我刚安装了Statamic。我使用普通安装,并复制了他们建议的.htaccess。由于某些原因,当我试图访问时,我得到了一个403禁止的错误。
.htaccess文件中是什么导致了这种情况,我如何重写它才能正常工作?
# Kick off base settings
RewriteEngine On
RewriteBase /
DirectorySlash Off
# Protect your system files
RewriteRule ^(_content) - [F,L]
RewriteRule ^(.*)?\.yml$ - [F,L]
Rewriterule ^(.*)?\.ya