我想为我的域创建一个自定义的网址。
例如,我想要这样的url:- mysite.com/ERJDII787HUKKS
而不是:- mysite.com/index.php?args=ERJDII787HUKS
我已经尝试过了:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^$ /index.php/$1 [L]
But its not working well please help!!发布于 2016-09-08 11:25:43
在根目录中尝试以下规则
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-l
RewriteRule ^([\w-]+)$ index.php?args=$1 [L]发布于 2016-09-08 10:21:57
您正在使用的正则表达式为空,因此它不能与您试图访问的任何URL匹配。你应该把它重写成你真正的URL。尝试使用以下命令:
RewriteRule ^(.*)$ /index.php?args=$1 [L]我希望这能解决你的问题。
https://stackoverflow.com/questions/39381530
复制相似问题