如何为我的自定义模块设置重写URL,重定向但不更改URL仍然使用请求路径URL,例如:
request path : domain.com/blah
target path : domain.com/myurl/profile/index?id=blahblah
当你打开请求路径时,不要重定向到目标路径,比如在产品url上,保持请求路径,或者如何从htaccess中删除"myurl/profile/index?id="?
感谢
出现错误的原因有很多,您应该确保在.htaccess文件中没有犯任何错误,因为您知道在.htacccess文件中查找错误并不容易。
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/