我正在尝试在线部署我的网站,.htaccess
在localhost
中完美运行的public
文件似乎在我的共享托管域中的工作方式不同。
我在根(htdocs)文件夹中有一个.htaccess
文件夹,用于提供公共文件,我在公共目录中使用了两个htdocs
文件,在根目录中使用了另一个RewriteCond %{HTTP_HOST} ^mysite\.morehere\.net$ [OR]
RewriteCond %{HTTP_HOST} ^www\.mysite\.morehere\.net$
RewriteCond %{REQUEST_URI} !^/public/
RewriteRule (.*) /public/$1
文件# --- Homepage
RewriteRule ^home$ index.php [NC]
RewriteRule ^home/$ index.php [NC,L]
# --- articles page
RewriteRule ^articles $ articles.php [NC]
RewriteRule ^articles /$ articles.php [NC]
........
)文件夹。
.htoccess for htdocs文件夹
mod_rewrite
和公共目录的
mysite.morehere.net/home/
我的目的是使URL搜索引擎更友好并吸引用户。
编辑:我确保生产服务器上的{{1}}已开启,但页面仍会被重定向到未找到的页面。
将{{1}}重定向到未找到的网页
任何人都可以帮我解决问题所在。
答案 0 :(得分:0)
检查生产服务器上是否已打开mod_rewrite