简体   繁体   English

如何修复我的 htaccess,它将我的页面全部重定向到一个索引

[英]How to fix my htaccess, it's redirecting my pages all to one index

I was on live chat with my domain support and they managed to delete the default htaccess file, now every url entered goes to my main index, what can I do to fix this?我正在与我的域支持人员进行实时聊天,他们设法删除了默认的 htaccess 文件,现在输入的每个 url 都转到我的主索引,我该怎么做才能解决这个问题?

Example: domain: example.com示例:域:example.com

If I have a folder under example.com/folder and go to it, the index for example.com shows instead of for that folder and if I put the path directly it stays in the browser but it shows the index for example.com always.如果我在 example.com/folder 下有一个文件夹并转到它,则显示 example.com 的索引而不是该文件夹的索引,如果我直接放置路径,它会保留在浏览器中,但它始终显示 example.com 的索引.

What can I write in my htaccess to fix this to how it used to be and keep mod rewrite enabled?我可以在我的 htaccess 中写什么来修复它以前的状态并保持启用 mod 重写?

Edit: also, every time I've asked them to fix it or reset it to default they claim that it's a web development issue and not theirs.编辑:此外,每次我要求他们修复它或将其重置为默认值时,他们都声称这是 Web 开发问题而不是他们的问题。 All they do is tell me to contact my developer.他们所做的就是告诉我联系我的开发人员。

hopefully, it works希望它有效

<IfModule mod_rewrite.c>
RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
#This last condition enables access to the images and css folders, and the robots.txt file
RewriteCond $1 !^(index\.php|public|images|robots\.txt|css)
RewriteRule ^(.*)$ index.php/$1 [L]
</IfModule>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM