Home  >  Q&A  >  body text

An error occurred while routing to the redirect address

think\Route::rule('my_jump','/face.php');

Tips for errors:

Image.png


VMVM2684 days ago1985

reply all(3)I'll reply

  • 天蓬老师

    天蓬老师2017-07-07 16:32:34

    First of all, the entry file is hidden. Now there is no need for manual operation by the user. The framework has added the rewrite file to the framework.

    thinkRoute::rule('my_jump','/face.php'); Where is the "/" in "/face.php" parsed? Among the five modes of routing address, there is no such syntax. If you want to route to an absolute address, please write it completely. Otherwise, do not add an extension and strictly follow the path_info rules.

    If all the above are correct, you can consider changing a browser and trying again.

    reply
    0
  • VM

    1. Teacher Zhu, my rewrite file does not work with the default one, which is the first comment, and rewrite is also enabled locally. #RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L] #RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L] RewriteRule ^(.*)$ index.php [L,E=PATH_INFO:$1] I searched online and found that both the second comment and the open one are feasible. Is this related to this? 2. Route::rule('routing rule', 'redirect address'); // What I am testing here is local I followed your instructions and redirected directly to face.php (echo directly in this file) under the root directory (public, the root directory is this folder in the vhost multi-site configuration) based on the route my_jump or myjump (customized). a string), I use Firefox (the result shown in the picture), Google (displays "You have too many redirects")

    VM · 2017-07-08 09:50:05
    VM

    Jump to the file in the root directory

    VM · 2017-07-08 09:59:57
    VM

    Teacher, I did it on the test server, and it works. I don’t need to change it when rewriting it (provided by the framework). I can also jump to the local root directory file on the site. Maybe my local environment is wrong. . . It seems that I really need to compare it locally and online. . .

    VM · 2017-07-08 11:50:07
    VM

    Thank you, Teacher Zhu, for your teaching! ! ! ~~~

    VM · 2017-07-08 11:53:15
  • VM

    VM2017-07-07 11:51:25

    I configured the rewrite rule to hide the entry file,

    <IfModule mod_rewrite.c>
    Options +FollowSymlinks -Multiviews
    RewriteEngine On

    RewriteCond %{REQUEST_FILENAME} !-d
    RewriteCond %{REQUEST_FILEN AME} !-f
    #RewriteRule ^(.*)$ index.php/$1 [QSA,PT,L]
    #RewriteRule ^(.*)$ index.php?s=$1 [QSA,PT,L]
    RewriteRule ^(.* )$ index.php [L,E=PATH_INFO:$1]
    </IfModule>

    reply
    0
  • VM

    VM2017-07-07 11:50:05

    http:// is ok

    reply
    0
  • Cancelreply