Url rewriting is not clear, and there is always an error in url. htaccess apache
I added a new Alias with Apache. The new website is http: // localhost/gyjw/
Enter http: // localhost/gyjw/to automatically jump to http: // localhost/gyjw/index. php
Http: // localhost/gyjw/index. php this is the login page of my website. after logging in, you will jump to http: // localhost/gyjw/main. php
Now I want to rewrite the http: // localhost/gyjw/index. php and http: // localhost/gyjw/main. php addresses.
Change http: // localhost/index. php and http: // localhost/main /? Id = 101
I wanted to rewrite the url by modifying the. htaccess file, but the RewriteCond and RewriteRule were not completed for a long time. I always jumped out of the error page 500, but I still don't understand it!
Can anyone help me implement this?
Reply to discussion (solution)
What should I do if I cannot directly use URLs for include in php?
I have never used Apache rewrite, but we recommend that you first test whether your regular expression is correct.
I have never used Apache rewrite, but we recommend that you first test whether your regular expression is correct.
Include ("index.html? Fun = 000 "); check ing check. php, the ING should be okay. Other links are written in this way, but it seems that only files cannot be used in the include file, so the url cannot be opened, which should be a class of PHP problems, I want to know how to use a virtual url to call and implement functions in other PHP files.
Include ("index.html? Fun = 000 "); check ing check. php, the ING should be okay. Other links are written in this way, but it seems that only files cannot be used in the include file, so the url cannot be opened, which should be a class of PHP problems, I want to know how to use a virtual url to call and implement functions in other PHP files.
A little messy. do you want to use the include function to implement URL rewriting?
I suggest you study. htaccess. it is rare to use the include function.
A little messy. do you want to use the include function to implement URL rewriting?
I suggest you study. htaccess. it is rare to use the include function.
Why? Fun = 000, but include ("index.html? Fun = 000 "); if an error occurs, it means you cannot open steam. I have no access to google.
Why? Fun = 000, but include ("index.html? Fun = 000 "); if an error occurs, it means you cannot open steam. I have no access to google.
Include is directly used, index.html? Fun = 000 is switched to check. php only after Apache
If you include a complete URL, such as http: // localhost/index.html? Fun = 000 is normal, provided that your include can reference the URL
Why? Fun = 000, but include ("index.html? Fun = 000 "); if an error occurs, it means you cannot open steam. I have no access to google.
Include is directly used, index.html? Fun = 000 is switched to check. php only after Apache
If you include a complete URL, such as http: // localhost/index.html? Fun = 000 is normal, provided that your include can reference the URL
All functions are enabled and tried. no.
Warning: include() [function.include]: URL file-access is disabled in the server configuration in D:\wamp\web\main.php on line 2Warning: include(http://localhost/gyjw/index.html?fun=000) [function.include]: failed to open stream: no suitable wrapper could be found in D:\wamp\web\main.php on line 2Warning: include() [function.include]: Failed opening 'http://localhost/gyjw/index.html?fun=000' for inclusion (include_path='.;C:\php5\pear') in D:\wamp\web\main.php on line 2
Php. ini
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.allow_url_fopen = On; Whether to allow include/require to open URLs (like http:// or ftp://) as files.allow_url_include = On
Why? Fun = 000, but include ("index.html? Fun = 000 "); if an error occurs, it means you cannot open steam. I have no access to google.
Include is directly used, index.html? Fun = 000 is switched to check. php only after Apache
If you include a complete URL, such as http: // localhost/index.html? Fun = 000 is normal, provided that your include can reference the URL
All functions are enabled and tried. no.
Warning: include() [function.include]: URL file-access is disabled in the server configuration in D:\wamp\web\main.php on line 2Warning: include(http://localhost/gyjw/index.html?fun=000) [function.include]: failed to open stream: no suitable wrapper could be found in D:\wamp\web\main.php on line 2Warning: include() [function.include]: Failed opening 'http://localhost/gyjw/index.html?fun=000' for inclusion (include_path='.;C:\php5\pear') in D:\wamp\web\main.php on line 2
Php. ini
; Whether to allow the treatment of URLs (like http:// or ftp://) as files.allow_url_fopen = On; Whether to allow include/require to open URLs (like http:// or ftp://) as files.allow_url_include = On
Are you sure you have configured the correct PHP. INI? This prompt appears only when allow_url_include = Off is set here. check whether your phpinfo () configuration is correct.
RewriteEngine on
RewriteRule ^ gate-(. *)-(. *)-(. * ).html $/test/$ 1.php? Mod = $2 & act = $3
ErrorDocument 404/404 .php
This is to redirect your gate-index-ok-bad.html page to index. php in the/test directory and provide the get request with two parameters mod = OK, act = bad
Study it yourself.
The final ErrorDocuemnt prevents leakage of file names due to malicious input of file names
This will redirect the 404 page to the/404. php page. Take a look at it for details.
Are you sure you have configured the correct PHP. INI? This prompt appears only when allow_url_include = Off is set here. check whether your phpinfo () configuration is correct.
Is there anything else to set? I also restarted the service.
Are you sure you have configured the correct PHP. INI? This prompt appears only when allow_url_include = Off is set here. check whether your phpinfo () configuration is correct.
Is there anything else to set? I also restarted the service.
There should be nothing else. I have no problem here and I don't know what your situation is.
There should be nothing else. I have no problem here and I don't know what your situation is. Well, solved the problem. I used the rewrite? Put? Change. I don't understand why. Can the standby system recognize index.html and index.html? Fun = 000 is a duplicate name.
Are you sure you have configured the correct PHP. INI? This prompt appears only when allow_url_include = Off is set here. check whether your phpinfo () configuration is correct.
Is there anything else to set? I also restarted the service.
There should be nothing else. I have no problem here and I don't know what your situation is.
And I encountered a new problem .... The $ _ SESSION ['SS _ user_id '] data in check. php does not exist.
And I encountered a new problem .... The $ _ SESSION ['SS _ user_id '] data in check. php does not exist.
There will be various problems with your messy reference.
We recommend that you put the php file in the same folder for convenient reference.
And I encountered a new problem .... The $ _ SESSION ['SS _ user_id '] data in check. php does not exist.
There will be various problems with your messy reference.
We recommend that you put the php file in the same folder for convenient reference. Er, they are all in a folder ..