本文介绍了.htaccess 重写我网站的 URL的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
也许你可以帮我重写我的 URL(我从来没有使用过 .htacces 文件).
maybe you can help me to rewrite my URL (i never worked with a .htacces-file).
示例:我有一个这样的 URL:localhost/index.php?s=example
Example: I have a URL like this: localhost/index.php?s=example
我怎么可能像这样使用这个 URL:localhost/example?
How i can chance this URL like this: localhost/example ?
也许你能帮我.
谢谢!
推荐答案您可以在 root/.htaccess
RewriteEngine on RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^([^/]+)/?$ /index.php?s=$1 [NC,L]此脚本将允许您使用干净的 url /foobar
This script will allow you to access /index.php?s=foobar using the clean url /foobar
更多推荐
.htaccess 重写我网站的 URL
发布评论