.htaccess我的网站公共部分的文件配置

时间:2014-11-08 20:06:50

标签: php apache .htaccess mod-rewrite

我正在尝试在线部署我的网站,.htaccesslocalhost中完美运行的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}}重定向到未找到的网页

任何人都可以帮我解决问题所在。

1 个答案:

答案 0 :(得分:0)

检查生产服务器上是否已打开mod_rewrite