Home  >  Article  >  Backend Development  >  RewriteRule hidden file extension problem...

RewriteRule hidden file extension problem...

WBOY
WBOYOriginal
2016-10-12 09:50:131022browse

#RewriteRule ^([^./]+)/?$ $1.php [L]

I have a website, let’s say it’s called xxx.com, and the directory where it’s stored is called xxx
The FTP path is
home2/*/public_html/xxx/

Since I did not use #RewriteRule ^([^./]+)/?$ $1.php [L]
so when I added another main website (home2/*/public_html/) After this code, when I enter xxx.com, it will become 404. I must add index.php to make it normal. This is equivalent to him automatically adding my xxx to this code... But I did not use this code in xxx.
So he read xxx.com into xxx.com/index, so it will get 404
How can I change this RewriteRule? Do not affect other directories!

My current approach is to add
RewriteRule ^index$ index.php [L]

to coexistence...but I don’t know what else will happen

My only website does not have hidden attachments My name is xxx, so it happened suddenly... I didn’t expect it to happen

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn