我在我的网站elixnews.com上使用以下代码从以下位置删除php扩展: RewriteEngine On RewriteBase / RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^\.]+)$ $1.php [NC,L] 要从我的链接中删除www和php扩展,但它不起作用: http : //elixnews.com/todays_news – 怎么了?
我是新的htaccess。 所以当我想要使用htacces做一个urlredirect,我总是得到一个redirect循环,并不知道如何解决它。 我一直在网上search,但没有find我的解决scheme。 请帮忙 我想要做的是将根目录(/ *)下的所有子页面redirect到根目录下的index.html(/index.html) 我需要将www.mydomain.com.au/*redirect到www.mydomain.com.au/index.html 这是我的代码 RewriteEngine On RewriteBase / RewriteRule ^(.*)$ http://www.mydomain.com.au/index.html [R=301,L] 请帮助如何解决这个非常感谢!
让我通过例子来解释… 文件: /var/www/example.com/public/wp-content/cache/minify/.htaccess <IfModule mod_rewrite.c> # THIS WORKS… RewriteBase /wp-content/cache/minify/ RewriteRule /w3tc_rewrite_test$ ../../plugins/w3-total-cache/pub/minify.php?w3tc_rewrite_test=1 [L] RewriteCond %{REQUEST_FILENAME}%{ENV:APPEND_EXT} -f RewriteRule (.*) $1%{ENV:APPEND_EXT} [L] RewriteRule ^(.+/[X]+\.css)$ ../../plugins/w3-total-cache/pub/minify.php?test_file=$1 [L] RewriteRule ^(.+\.(css|js))$ ../../plugins/w3-total-cache/pub/minify.php?file=$1 [L] </IfModule> 文件: /etc/apache2/httpd.conf <Directory /var/www/example.com/public> AllowOverride None Options -MultiViews […] <IfModule mod_rewrite.c> Options +FollowSymlinks # Options +SymLinksIfOwnerMatch RewriteEngine On # RewriteBase / </IfModule> […] <IfModule mod_rewrite.c> […]
我有点麻烦得到标准的mod_rewrite wordpress在我的导演.htaccess文件生成正常工作。 我使用的服务器默认情况下已经设置了一个虚拟主机,我对这些虚拟主机没有经验。 我已经达到了一个点,我的头痛,撞在墙上,所以任何帮助表示赞赏。 所以假设,我们可以说我的领域是: http://domain.com 我有我的WordPress的 http://domain.com/wordpress 所以对于我漂亮的链接,domain.com/wordpress中的.htaccess文件显示如下: <IfModule mod_rewrite.c> RewriteEngine On RewriteBase /wordpress/ RewriteRule ^index\.php$ – [L] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d </IfModule> 和我的虚拟主机configuration文件位于etc / apache2 / sites-available / domain.com.conf: <VirtualHost *:80> ServerName app01 ServerAlias domain.com www.domain.com DocumentRoot /var/www/vhosts/application/ <Directory /var/www/vhosts/application> Options FollowSymLinks AllowOverride All Order allow,deny Allow from all </Directory> <Directory […]
我的网站已经用JAVA实现了。 所以我们采取了VPS并且安装了Tomcat然后部署了我的网站是这样出现的 每当我点击www.mysite.com在url…它出现在下面。 http://mysite.com:8080/foldername/ 但我想看到我的网站www.mysite.com 任何人可以build议我该怎么做..我应该做任何改变的htaccess文件?
我在Apache服务器(共享主机)上托pipe一个WordPress的博客。 由于某些原因,我一直在收到几十个xmlrpc.php每秒100个请求。 access.log如下所示: … 188.138.33.149 – – [16/Oct/2013:17:46:03 +0200] "POST /xmlrpc.php HTTP/1.1" 403 212 "-" "GoogleBot/1.0" 188.138.33.149 – – [16/Oct/2013:17:46:03 +0200] "POST /xmlrpc.php HTTP/1.1" 403 212 "-" "GoogleBot/1.0" 188.138.33.149 – – [16/Oct/2013:17:46:03 +0200] "POST /xmlrpc.php HTTP/1.1" 403 212 "-"" … 在.htaccess中,我应用了以下规则: <Files xmlrpc.php> Order Deny,Allow Deny from all </Files> 有没有更好的方法来防止垃圾邮件?
我用PHP-FPM(5.4.20)安装了nginx(1.4.3)。 我想保护我的wordpress wp-admin文件夹。 我的nginxconfiguration文件domain.conf : server { listen 80; server_name example.com; root /var/www; location / { index index.php; try_files $uri $uri/ /index.php?$args; } location /wp-admin { index index.php; allow 192.168.1.2; deny all; } location ~ \.php$ { fastcgi_pass 127.0.0.1:9000; fastcgi_index index.php; fastcgi_param PATH_INFO $fastcgi_script_name; fastcgi_param SCRIPT_FILENAME /var/www$fastcgi_script_name; include fastcgi_params; } } 问题:当我加载wp-admin文件夹在不同的ip我有403(罚款),但我能够加载insite PHP文件。 像/wp-admin/about.php
我在.htaccess文件中有以下重写规则 RewriteRule ^js_([A-Za-z0-9\.\_\-]{1,50})\.php$ libjs/misc/$1.js 所以js_messages.php url链接到libjs / misc / messages.js文件 它运行良好,但现在我需要从一些.js文件执行php代码。 我怎样才能做到这一点? 谢谢。 PS抱歉我的英语
我在symphony目录下运行Symphony安装,但是我想在特定情况下从URL中删除这个单词。 当用户访问 http://domain.com/demo 它应该去 http://domain.com/symphony/demo 因为我已经为demo添加了一个特定的规则。 如果我没有在.htaccess添加一个demo的特定规则,那么它应该parsing为 http://domain.com/demo 如input。 这将路由到我们的应用程序的另一部分。
我是一个时尚网站和使用wordpress。 我想要压缩或Gzip或放气我的CSS和JS文件 。 我已经尝试了许多代码与.htaccess压缩,但不工作 。 请任何机构帮助我吗? 我的phpinfo是http://deemasfashion.co.uk/1.php 下面是我试过的代码不工作。 他们中几乎没有一个可能是相同的,但语法有所不同。 <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </ifModule> 其他代码,我已经尝试,但不工作… <files *.css> SetOutputFilter DEFLATE </files> <files *.js> SetOutputFilter DEFLATE </files> 我也试过这个代码,但没有成功。 <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file \.(html?|txt|css|js|php|pl)$ […]