【发布时间】:2020-06-04 08:55:07
【问题描述】:
我已经用 Codeigniter 和
开发了一个应用程序我想以此重写我的 GET 查询字符串 -
https://www.example.com/search?state=American%20Samoa
到这里
https://www.example.com/job-vacancies-in-American-Samoa
我可以选择任何使用 .htaccess 或 CI route.php 的解决方案
我当前的 .htaccess 文件
RewriteOptions inherit
RewriteEngine on
#Force https:
RewriteCond %{HTTPS} !=on
RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
#CI index.php removal
RewriteCond $1 !^(index\.php|public|\.txt)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php?$1
RewriteRule ^admin/(.*)$ /$1 [L,NC,R]
【问题讨论】:
标签: php .htaccess codeigniter url-rewriting routing