不在URL中添加问号就无法访问链接
Cant visit links without adding a question mark to the URL
每次点击URL时,我都会得到一个404。那是因为找不到页面。但是当我在.domain后面添加一个问号时,页面就会被找到。当我把网站托管在子域文件夹中时,这不是问题所在。访问一个页面需要一个问号,我不想有这个问号。
请查看网址:http://www.ankehesselmann.nl/
我正在使用StaceyApp
这是我的.htaccess
RewriteEngine on
# Some hosts require a rewritebase rule, if so, uncomment the RewriteBase line below. If you are running from a subdirectory, your rewritebase should match the name of the path to where stacey is stored.
ie. if in a folder named 'stacey', RewriteBase /stacey
RewriteBase /stacey
ErrorDocument 404 /404.html
# Rewrite any calls to *.html, *.json, *.xml, *.atom, *.rss, *.rdf or *.txt if a folder matching * exists
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !public/
RewriteCond %{DOCUMENT_ROOT}/public/$1.$2 !-f
RewriteRule (.+)'.(html|json|xml|atom|rss|rdf|txt)$ $1/ [L]
#Add a trailing slash to directories
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !('.)
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ([^/]+)$ $1/ [L]
# Rewrite any calls to /* or /app to the index.php file
RewriteCond %{REQUEST_URI} /app/$
RewriteRule ^app/ index.php [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)/$ index.php?$1 [L]
# Rewrite any file calls to the public directory
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !public/
RewriteRule ^(.+)$ public/$1 [L]
我猜RewriteBase在.htaccess中被设置到了错误的文件夹虽然我无法解释为什么它能像你说的那样使用问号,但我会尝试正确设置重写库。
如果你有子文件夹,你必须放它(从域名到索引文件的路径)。例如:
网址:example.com/folder1/sub/
RewriteBase /folder1/sub/
如果你的网站没有子文件夹:
RewriteBase /
如果没有子文件夹,您可以尝试删除该行,但如果设置为/(斜线),则不会产生任何问题。
相关文章:
- 如何使用JavaScript访问HTML链接内容
- 响应式图片库,每个图片都可以通过锚链接访问
- 每5次访问后更改链接URL
- 当某些内容发生变化时,如何将已访问的链接更改为未访问的链接
- 用户单击带有哈希值的链接以访问该页面,如果禁用Javascript会发生什么情况
- 如何将链接状态设置为在用户访问另一个页面之前保持
- 访问Chrome书签中链接页面的DOM
- Angular2/Typescript:从链接可观察函数访问实例变量
- :访问链接而不离开页面
- 循环访问链接对象,如何避免重复
- 访问链接函数内的当前自定义指令元素
- 如何访问链接的“previous”方法
- 使用 Javascript 设置访问链接的颜色
- 不在URL中添加问号就无法访问链接
- Extjs:访问链接在窗口中的属性网格
- 在现代浏览器中,是否没有已知的方法可以使用jQuery获取访问链接
- 如何使用javascript动态更改访问链接的颜色
- 只允许从特定页面访问链接
- 从PHP传递的Javascript访问链接
- 在指令中访问链接/作用域的问题