尽管在Wamp工作中
我想重写网站的URL,在Wamp中,这项工作非常好,但是当我安装Xamp时,这不起作用。
在我的文件.htaccess中,
RewriteEngine On
RewriteRule ^([A-Za-z0-9-]+)/?([A-Za-z0-9-]+)?/?([A-Za-z0-9-]+)?/?$ ./index.php?q1=$1&q2=$2&q3=$3&q4=$4&q5=%5
当我在本地主机中打开项目时,它显示了报告“通知:未定义的索引:c:\ xampp \ htdocs \ htdocs \ admaposta \ admaposta \ index.php在第6行上”,也向其他变量发送给其他变量。 。
我已经搜索了答案,而我的httpd.conf在所有内容和行中都有“允许的”。
I want to rewrite the url of my site, in wamp this work very well, but when I installed the xamp this not worked.
in my file .htaccess i have this
RewriteEngine On
RewriteRule ^([A-Za-z0-9-]+)/?([A-Za-z0-9-]+)?/?([A-Za-z0-9-]+)?/?$ ./index.php?q1=$1&q2=$2&q3=$3&q4=$4&q5=%5
when I open the project in my localhost it shows the report "Notice: Undefined index: q1 in C:\xampp\htdocs\admaposta\index.php on line 6" and also to the other variables.
I've already search for answers and my httpd.conf have "AllowOverride All" in everything and the line "LoadModule rewrite_module modules/mod_rewrite.so" is not commented.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您会出现错误报告,如果您不想看到它,则应关闭,此外,重写可能正在起作用,但您仍然存在一些错误,这可能不会引起初始问题,但假设已设置了变量。
您甚至可以在您的php-settings中发出警告;
或只需将其添加到您的PHP文件中即可显示。
资料来源:“注意:” “,”警告:未定义的数组密钥”和“通知:未定义的偏移”使用PHP ,
因为这是一个新的安装,您可能需要调整XAMPP的安装,并使用WAMPP安装进行检查。
有关WAMPP安装的设置,请参见php.ini文件,然后更改XAMPP安装中的php.ini。
You got error reporting on and should be turned off if you do not want to see it, also the rewrite might be working but you still have some errors, which may not cause initial problems but assume variables are set.
You could even turn of the warnings in you PHP-settings;
or just add this in your php file to not show it.
Source: "Notice: Undefined variable", "Notice: Undefined index", "Warning: Undefined array key", and "Notice: Undefined offset" using PHP
Since this is a new installation you might want to adapt your installation of XAMPP and check with your WAMPP installation what settings are used.
see the php.ini file for the settings of your wampp installation and change the php.ini in your xampp installation.