douwei2966 2017-02-04 09:07
浏览 26

网址重写错误

I want to get parameter from http://domain.com/class/9th-class I am using RewriteRule ^class/(.*)/?$ classes_list.php?get_page=$1 [NC,QSA] to get get_page GET parameter. but it is changing my URL to http://domain.com/class/9th-class?get_page=9th-class i dont want to change URL but i want to get the url parameter. If u have any solution please let me know. my whole .htaccess is

RewriteEngine On

RewriteEngine On
RewriteCond %{QUERY_STRING} page_id [NC]
RewriteRule ^ - [F]

RewriteRule ^signup/?$ signup.php [NC,QSA]
RewriteRule ^signin/?$ signin.php [NC,QSA]
RewriteRule ^contactus/?$ contactus.php [NC,QSA]

RewriteRule ^freelectures/?$ free_lectures.php [NC,QSA]
RewriteRule ^videos/(.*)/?$ video_details.php?get_page=$1 [NC,QSA]
RewriteRule ^class/(.*)/?$ classes_list.php?get_page=$1 [NC,QSA]

RewriteRule ^course/(.*)/?$ course_details.php?get_page=$1 [NC,QSA]

RewriteRule ^mcqs/(.*)/?$ mcqs_list.php?get_page=$1 [NC,QSA]


RewriteRule ^404/?$ 404.php [NC,QSA]

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule .* /404 [L]

AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript


RewriteCond %{HTTP_USER_AGENT} libwww-perl.* 
RewriteRule .* ? [F,L]

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

RewriteCond %{HTTP_HOST} !^www\.
RewriteCond %{HTTPS}s on(s)|offs()
RewriteRule ^ http%1://www.%{HTTP_HOST}%{REQUEST_URI} [NE,L,R]

<IfModule mod_expires.c>
    ExpiresActive on
# Default directive
ExpiresDefault "access plus 1 month"
 # My favicon
ExpiresByType image/x-icon "access plus 1 year"
    ExpiresByType image/jpg "access plus 1 year"
    ExpiresByType image/jpeg "access plus 1 year"
    ExpiresByType image/gif "access plus 1 year"
    ExpiresByType image/png "access plus 1 year"
    # CSS
ExpiresByType text/css "access plus 1 year"
# Javascript
ExpiresByType application/javascript "access plus 1 year"
</IfModule>
<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>
  • 写回答

0条回答 默认 最新

    报告相同问题?

    悬赏问题

    • ¥15 linux驱动,linux应用,多线程
    • ¥20 我要一个分身加定位两个功能的安卓app
    • ¥15 基于FOC驱动器,如何实现卡丁车下坡无阻力的遛坡的效果
    • ¥15 IAR程序莫名变量多重定义
    • ¥15 (标签-UDP|关键词-client)
    • ¥15 关于库卡officelite无法与虚拟机通讯的问题
    • ¥15 目标检测项目无法读取视频
    • ¥15 GEO datasets中基因芯片数据仅仅提供了normalized signal如何进行差异分析
    • ¥100 求采集电商背景音乐的方法
    • ¥15 数学建模竞赛求指导帮助