For apache server rewrite, I aim to enter the url in the address bar:
Http: // localhost/project/URLs/index. php/149Ui3
Automatically rewrite
Http: // localhost/project/dynamic URL/index. php? Controller = jump & method = jemp & code = 149Ui3
Add the following configuration in apache (apache2.conf ):
# Turn on rewrite engine Options +FollowSymlinks RewriteEngine on # More rules below RewriteRule ^index.php/(.*)$ index.php?controller=jump&method=jump&code=$1 [QSA]
But it cannot be redirected. how can I configure it correctly.
Reply to discussion (solution)
1. is the rewrite module enabled correctly in httpd. conf?
2. is the configuration file you wrote valid?
I did not find the httpd. conf file in ubuntu. The main configuration file is only apach2.conf, and the current configuration is like this.
1. create a. htaccss file in the/var/www/project/upload URL directory as follows:
# Turn on rewrite engineOptions +FollowSymlinksRewriteEngine on# More rules belowRewriteRule ^index.php/(.*)$ index.php?controller=jump&method=jump&code=$1 [QSA
2. make the following configuration in apach2.conf:
Options FollowSymLinks AllowOverride ALL Require all granted
The problem is as follows:
The problem is that http: // localhost/project/upload URL/index is entered each time. php/149Ui3 will display http: // localhost/project/invalid URL/index without css style control. php content (the address bar is http: // localhost/project/URL/index. php/149Ui3), cannot jump to http: // localhost/project/upload URL/index. php? Controller = jump & method = jemp & code = 149Ui3
1. is the rewrite module enabled correctly in httpd. conf?
2. is the configuration file you wrote valid?
As shown in #2 floor. sorry for the error.
The problem is solved. to sum up:
Problem description:
My purpose is to enter the url in the address bar:
Http: // localhost/project/URLs/index. php/149Ui3
Automatically rewrite
Http: // localhost/project/dynamic URL/index. php? Controller = jump & method = jump & code = 149Ui3
Solution
1. make the following configuration in apach2.conf:
Options FollowSymLinks
AllowOverride ALL
Require all granted
2. create a. htaccss file in the/var/www/project/upload URL directory as follows:
# Turn on rewrite engine
RewriteEngine on
# More rules below
RewriteBase/
RewriteRule ^ index. php/(. *) $ http: // localhost/project/invalid URL/index. php? Controller = jump & method = j ump & code = $1 [L, R = 301]
Conclusion
I have to read more documents when it's okay. thanks to the idea provided by the open-source Chinese crazy snail bait.