又一个新的.htaccess问题 [英] again a new .htaccess issue

查看:202
本文介绍了又一个新的.htaccess问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的一个网址有这个 /index.php?page=cfeedback&status_id=2&cf_store=8 ...应用此之后的 的htaccess 只显示URL中的 /index.php?page=cfeedback
任何可以这样做吗?

有些还只是 /index.php?page=dashboard。

我的 的.htaccess 应该以这种方式支持。

  /仪表盘的URL /index.php?page=dashboard

/ cfeedback / 2/8网址/index.php?page=cfeedback&status_id=2&cf_store=8
 

这是一个延续了这个问题:<一href="http://stackoverflow.com/questions/27835855/htaccess-file-is-not-at-all-working-on-godaddy-server/27840490#27840490">.htaccess文件没有在所有的工作GoDaddy的服务器上

我的 的.htaccess code

 选项+了FollowSymLinks -MultiViews
RewriteEngine叙述上

#使用适当改写基地
的RewriteBase / MYDIR /管理/

的RewriteCond%{REQUEST_METHOD} ^(TRACE | TRACK | GET | POST | HEAD)!$
重写规则^  -  [F]

的RewriteCond%{} THE_REQUEST /index\.php\?page=([\w-]+)[NC]
重写规则^%1? [L,R]

的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^([\ w  - ] +)?/ $ index.php页面= $ 1 [L,QSA]
 


我尝试添加以下code具有网址 index.php页面1 = $&放大器; status_id = $ 2 。请让我知道我做错了。

 的RewriteCond%{} THE_REQUEST /index\.php\?page=([\w-]+)&status_id=([\w-]+)[NC]
重写规则^%1 /%2? [L,R]
的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^([\ w  - ] +)/([\ w  - ] +)1 / $ index.php页面= $&放大器;?status_id = $ 2 [L,QSA]
 


我在做什么错在这里?

 选项+了FollowSymLinks -MultiViews
RewriteEngine叙述上

#使用适当改写基地
的RewriteBase / MYDIR /管理/

的RewriteCond%{REQUEST_METHOD} ^(TRACE | TRACK | GET | POST | HEAD)!$
重写规则^  -  [F]

的RewriteCond%{} THE_REQUEST /index\.php\?page=([\w-]+)&status_id=([\w-]+)&cf_store=([\w-]+)[NC]
重写规则^%1/2%/ 3%? [L,R]

的RewriteCond%{} THE_REQUEST /index\.php\?page=([\w-]+)&status_id=([\w-]+)[NC]
重写规则^%1 /%2? [L,R]

的RewriteCond%{} THE_REQUEST /index\.php\?page=([\w-]+)\s [NC]
重写规则^%1? [L,R]

的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^([\ w  - ] +)/([\ w  - ] +)/([\ w  - ] +)1 / $ index.php页面= $&放大器;?status_id = $ 2及cf_store = $ 3 [L ,QSA]

的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^([\ w  - ] +)/([\ w  - ] +)1 / $ index.php页面= $&放大器;?status_id = $ 2 [L,QSA]

的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^([\ w  - ] +)?/ $ index.php页面= $ 1 [L,QSA]
 

解决方案

插入新的规则集早期规则之前:

 选项+了FollowSymLinks -MultiViews
RewriteEngine叙述上

#使用适当改写基地
的RewriteBase / MYDIR /管理/

的RewriteCond%{REQUEST_METHOD}(TRACE | TRACK | GET | POST | HEAD)
重写规则^  -  [L]

的RewriteCond%{} THE_REQUEST /index\.php\?page=([\w-]+)&status_id=([\w-]+)&cf_store=([\w-]+)[NC]
重写规则^%1/2%/ 3%? [L,R]

的RewriteCond%{} THE_REQUEST /index\.php\?page=([\w-]+)\s [NC]
重写规则^%1? [L,R]

的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^([\ w  - ] +)/([\ w  - ] +)/([\ w  - ] +)1 / $ index.php页面= $&放大器;?status_id = $ 2及cf_store = $ 3 [L ,QSA]

的RewriteCond%{} REQUEST_FILENAME!-d
重写规则^([\ w  - ] +)?/ $ index.php页面= $ 1 [L,QSA]
 

One of my URL has this /index.php?page=cfeedback&status_id=2&cf_store=8 ... After applying this htaccess it shows only /index.php?page=cfeedback in the URL.
Anything can be done for this?

Some pages also are just /index.php?page=dashboard.

My .htaccess should support both in this fashion.

/dashboard for URLs /index.php?page=dashboard

/cfeedback/2/8 for URLs /index.php?page=cfeedback&status_id=2&cf_store=8 

This is a continuation of this issue: .htaccess file is not at all working on godaddy server

My .htaccess code is

Options +FollowSymLinks -MultiViews   
RewriteEngine on

# use appropriate rewrite base
RewriteBase /mydir/admin/

RewriteCond %{REQUEST_METHOD} !^(TRACE|TRACK|GET|POST|HEAD)$
RewriteRule ^ - [F]

RewriteCond %{THE_REQUEST} /index\.php\?page=([\w-]+) [NC]
RewriteRule ^ %1?  [L,R]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/?$ index.php?page=$1 [L,QSA]


I tried adding the following code for urls having index.php?page=$1&status_id=$2 . Please let me know what I am doing wrong.

RewriteCond %{THE_REQUEST} /index\.php\?page=([\w-]+)&status_id=([\w-]+) [NC] 
RewriteRule ^ %1/%2? [L,R] 
RewriteCond %{REQUEST_FILENAME} !-d 
RewriteRule ^([\w-]+)/([\w-]+)/?$ index.php?page=$1&status_id=$2 [L,QSA]


What am I doing wrong here?

Options +FollowSymLinks -MultiViews   
RewriteEngine on

# use appropriate rewrite base
RewriteBase /mydir/admin/

RewriteCond %{REQUEST_METHOD} !^(TRACE|TRACK|GET|POST|HEAD)$
RewriteRule ^ - [F]

RewriteCond %{THE_REQUEST} /index\.php\?page=([\w-]+)&status_id=([\w-]+)&cf_store=([\w-]+) [NC]
RewriteRule ^ %1/%2/%3?  [L,R]

RewriteCond %{THE_REQUEST} /index\.php\?page=([\w-]+)&status_id=([\w-]+) [NC]
RewriteRule ^ %1/%2?  [L,R]

RewriteCond %{THE_REQUEST} /index\.php\?page=([\w-]+)\s [NC]
RewriteRule ^ %1?  [L,R]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/([\w-]+)/([\w-]+)/?$ index.php?page=$1&status_id=$2&cf_store=$3 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/([\w-]+)/?$ index.php?page=$1&status_id=$2 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/?$ index.php?page=$1 [L,QSA]

解决方案

Insert new set of rules before earlier rules:

Options +FollowSymLinks -MultiViews   
RewriteEngine on

# use appropriate rewrite base
RewriteBase /mydir/admin/

RewriteCond %{REQUEST_METHOD} (TRACE|TRACK|GET|POST|HEAD)
RewriteRule ^ - [L]

RewriteCond %{THE_REQUEST} /index\.php\?page=([\w-]+)&status_id=([\w-]+)&cf_store=([\w-]+) [NC]
RewriteRule ^ %1/%2/%3?  [L,R]

RewriteCond %{THE_REQUEST} /index\.php\?page=([\w-]+)\s [NC]
RewriteRule ^ %1?  [L,R]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/([\w-]+)/([\w-]+)/?$ index.php?page=$1&status_id=$2&cf_store=$3 [L,QSA]

RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([\w-]+)/?$ index.php?page=$1 [L,QSA]

这篇关于又一个新的.htaccess问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆