[英]Redirect old URL to new URL in .htaccess
.htaccess file .htaccess 文件
# Apache configuration file (see httpd.apache.org/docs/current/mod/quickreference.html)
# disable directory listing
<IfModule mod_autoindex.c>
Options -Indexes
</IfModule>
# enable cool URL
<IfModule mod_rewrite.c>
RewriteEngine On
# RewriteBase /
# prevents files starting with dot to be viewed by browser
RewriteRule /\.|^\.(?!well-known/) - [F]
# front controller
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule !\.(pdf|js|ico|gif|jpg|png|css|rar|zip|tar\.gz|map)$ index.php [L]
</IfModule>
# enable gzip compression
<IfModule mod_deflate.c>
<IfModule mod_filter.c>
AddOutputFilterByType DEFLATE text/html text/plain text/xml text/css application/x-javascript text/javascript application/javascript application/json
</IfModule>
</IfModule>
I use Nette FW, I want to migrate from Nette\Application\Routers\SimpleRouter to cool URLs.我使用 Nette FW,我想从 Nette\Application\Routers\SimpleRouter 迁移到酷 URL。
http://test.localhost/?action=add&presenter=Cr => http://test.localhost/cr/add http://test.localhost/?action=add&presenter=Cr => http://test.localhost/cr/add
http://test.localhost/?id=303&action=edit&presenter=Cr => http://test.localhost/cr/edit/?id=30 http://test.localhost/?id=303&action=edit&presenter=Cr => http://test.localhost/cr/edit/?id=30
How can I redirect all URLs to new URL?如何将所有 URL 重定向到新 URL?
when you already use netteRouter, you can use there one way router rules当您已经使用 netteRouter 时,您可以使用一种方式的路由器规则
viz.即。 https://doc.nette.org/en/application/routing#toc-one-way-flag https://doc.nette.org/en/application/routing#toc-one-way-flag
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.