Articles of .htaccess

覆盖服务器上的.htaccess文件

我的.htaccess文件包含url映射,我的脚本每天创build一次这些条目。 由于.htaccess是服务器上的隐藏文件,当脚本试图覆盖这个.htaccess文件时,我得到一个错误信息Access Denied 。 有没有办法覆盖文件。

Zend:.htaccess现在不能在windows上工作如何继续我的项目?

我在中期开始了一个项目的工作。 我们在Ubuntu上使用Zend Framework,PHP,MySql,Ajax,jQuery和jSon。 这是在Ubuntu的工作。 现在我切换到Windows。 我安装了Wamp,Eclipse,并在我的项目的窗口上创build一个主机(test.dev)。 但是,当通过test.dev启动项目。 它给我在浏览器窗口上的以下错误: Internal Server Error The server encountered an internal error or misconfiguration and was unable to complete your request. Please contact the server administrator, admin@localhost and inform them of the time the error occurred, and anything you might have done that may have caused the error. More information […]

XAMPP图像不显示/损坏( – 可能.htaccess)

我正在使用XAMPP在VPS的本地主机上托pipe一个网站。 当我去到网站上的VPS直接通过本地主机或从我自己的计算机远程 – 图像不加载和出现破损,当我尝试直接查看图像我给错误404和对象没有find。 图像path在htdocs中是完全正确的。 例如, http://mysite.com/icons/pixels.gif 我复制该链接,检查htdocs,这正是图像应该是我还给404错误和对象找不到。 然而。 没有机会,我把“图标”从“我”改成了大写字母,图像正常加载。 htdocs中的图标文件夹没有大写字母。 问题可能是我的.htaccess文件,虽然,这是一个链接: http : //pastebin.com/vUnhjb2A

IndexIgnore不允许在这里

我已经下载了SimpleInvoices开源应用程序。 它的.htaccess文件有以下代码 IndexIgnore * <FilesMatch "\.(htaccess|htpasswd|ini|phps|fla|psd|log|sh|tpl)$"> Order Allow,Deny Deny from all </FilesMatch> <FilesMatch "\.(htm|html|css|js|php)$"> AddDefaultCharset UTF-8 </FilesMatch> RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/?([a-zA-Z0-9_]+)-([a-zA-Z0-9_]+)-([a-zA-Z0-9_]+)?$ index.php?module=$1&view=$2&id=$3 RewriteCond %{REQUEST_FILENAME} !-f RewriteRule ^/?([a-zA-Z0-9_]+)-([a-zA-Z0-9_]+)$ index.php?module=$1&view=$2 [L] 即从IndexIgnore *指令开始。 不幸的是,这个指令导致我的Apache / 2.2.17(Win32)PHP / 5.3.8(在Windows 8上运行)出错。 为什么?

使用.htaccess从URL中删除特殊字符

我正在尝试在example.com/@lorem-ipsum-dolor而不是example.com/tag/lorem-ipsum-dolor表单上使用我的网站上的url。 它在我的本地和远程服务器上工作,但如果url包含" : \ * | etc等字符,它不能在本地服务器上运行(Win XP)。 有没有解决办法? 如果没有,那么我想我需要删除从本地服务器上的URL字符。 我GOOGLE了很多,但没有结果正确。 任何想法?

在Windows服务器上运行的Apache是​​一个htaccess文件不同

我build立一个运行Apache的Windows服务器上的网站,需要使用.htaccess文件的漂亮的url。 如果我添加.htaccess文件它只是被忽略,我需要使用somehting其他? 在Windows服务器上忽略.htaccess? 感谢您的帮助。

在Windows上使用htaccess文件 – 实际上保存文件为.htaccess?

在Windows上使用htaccess文件时,是否可以将文件保存为.htaccess ? (而不必在LAMP服务器上重命名)

easyphp .htaccess规则

我需要在Windows 7的easyphp安装中重写规则。 我需要确保规则正确加载,我不必制定吨规则。 另外,当我复制.htaccess到我的服务器(这是Linux),我想确保其工作正常。 我没有这方面的经验,这里是我发现互联网: RewriteRule (.*) index.php?s=$1 现在,如果我有像“联系我们”这样的基本页面,但是如果我有子页面则不行。 我怎样才能创build子文件夹? 谢谢

用查询string重写URL

继续我在这里问我想要自动重写下面的url http://testsite.com/siterootb/sample-page.php?bbi=value1&bbl=value2 至 http://testsite.com/siterootb/sample-page/value1/value2 我的htaccess现在看起来像 RewriteEngine on RewriteCond %{QUERY_STRING} !^$ RewriteRule ^(.*) http://localhost%{REQUEST_URI}%1? [R=301,L] ########################################################################### RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_URI} ^/siterootb/([^/]+)/([^/]+)/([^/]+) RewriteCond %{DOCUMENT_ROOT}/siterootb/%1.php -f RewriteRule ^/?([^/]+)/([^/]+)/([^/]+) $1.php?bbi=$2&bbl=$3 [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteCond %{REQUEST_FILENAME}.php -f RewriteRule ^(.*)$ $1.php [L] 我已经通过URL重写 – 查询string , url重写查询string , wordpress如何删除? 从url使用htaccess和更多,无论我从[query-string] [.htaccess]

htaccess重写真实的目录path到一个不同的,不存在的url,隐藏真正的path

我想使用目录___test像/___test/subdirectory1/和有一些内容,但从来没有在URL中显示此path。 相反,我想要url /demo/subdirectory1或者说/demo/subdirectory1/images/image.jpg指向/___test/subdirectory1/images/image.jpg和浏览器上的url保持如下: /demo/subdirectory1/images/image.jpg 。 实际上用demoreplace___test 我曾经尝试过的各种问题,虽然它看起来像它的作品有时是: RewriteRule ^demo/subdirectory1(.*) ___test/subdirectory1/$1 以上只适用于: demo/subdirectory1或demo/subdirectory1/ (现有内容示例index.html里面/___test/subdirectory1/ ),但不在demo/subdirectory1/somethingmore…虽然内容在这种情况下好吧,不幸的是它显示了URL中的真实目录path。 此外,我正在使用以下通过404到任何从/___test在URL中的任何: RewriteCond %{THE_REQUEST} ^GET\ /___test/ RewriteRule ^___test/(.*) – [R=404,L,NC] 它的工作原理,但是当我添加这个,那么以前也去404,不幸的是(再次)。 但对我来说,最重要的是要使第一部分正确,即使我从不做第二项工作。 任何帮助真的很感激。 谢谢。 编辑1:我也尝试在/___test/subdirectory1/.htaccess添加以下/___test/subdirectory1/.htaccess Options +FollowSymLinks RewriteEngine On RewriteBase /___test/subdirectory1 没有成功。 编辑2:虽然效果不佳,但在Jon Lin的帮助下,最好的结论是: RewriteCond %{REQUEST_URI} ^/demo/subdirectory1(.*) RewriteCond %{DOCUMENT_ROOT}/___test/subdirectory1/%1 -f [OR] RewriteCond %{DOCUMENT_ROOT}/___test/subdirectory1/%1 -d RewriteRule ^ /___test/subdirectory1/%1 [L] /demo/subdirectory1 < – 确定 […]