【发布时间】:2018-01-12 06:34:55
【问题描述】:
我在测试服务器上上传了我的代码,链接如下
http://dynamicwebsite.co.in/kk/ksmotors/tafe/aboutus.html
现在我想当有人点击下面的 URL 然后用户重定向到上面的 URL
http://dynamicwebsite.co.in/kk/ksmotors/tafe/index.php?page=aboutus.php
我使用了以下 .htaccess 代码,但它不起作用
RewriteEngine On
#RewriteRule ^index.php?page=(.*).php/?$ $1/$2.html$3 [R=301,L]
#RedirectMatch 301 /form/5/.* www.example.com/form/12/name.html
RedirectMatch 301 /index.php?page=aboutus.php http://dynamicwebsite.co.in/kk/ksmotors/tafe/aboutus.html
#Disable php and html files in storage folders
RedirectMatch 403 (admin\/accessory\/images|admin\/careers\/images|admin\/categories\/images|admin\/css|admin\/images|admin\/jqgrid|admin\/models\/images|admin\/submodels\/images|css|images|js|php-captcha|resume|spec_doc).+\.(php|php3?|phtml|html)$
#Disable Directory Listing
Options -Indexes
你能解释一下出了什么问题吗? 请帮忙。 谢谢
【问题讨论】:
-
我已经尝试过了,但是没有用。我对 .htaccess 没有更多的想法
标签: php html .htaccess url redirect