如何设置自定义模块的重写URL,重定向但不更改URL仍然使用请求路径URL,例如:
request path : domain.com/blah
target path : domain.com/myurl/profile/index?id=blahblah
当您打开请求路径而不是重定向到目标路径时,例如产品网址停留在请求路径上,或者如何删除" myurl / profile / index?id =" 来自htaccess?
由于
答案 0 :(得分:0)
出现错误的原因很多,你应该确定你的.htaccess没有犯错,因为你知道在你的.htaccess文件中找不到你的错误并不容易。
RewriteEngine On
RewriteBase /
RewriteEngine On Options All -Indexes RewriteBase /directoryname/ RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
############### SEO ##########################
#http://www.example.com/hello/booboo/ it takes the url after .com/
RewriteRule ^(.*)$ index.php?url=$1 [QSA,L]
# in index.php if you write echo $_GET['url']; you will see /hello/booboo/