My goal is to enter the URL in the address bar:
Http://localhost/project/ShortURL/index.php/149Ui3
Automatically rewritten as
Http://localhost/project/ShortURL/index.php?controller=jump&method=jemp&code=149Ui3
Apache adds the following configuration (apache2.conf):
# Turn on rewrite engine Options +followsymlinks rewriteengine in # more rules below rewriterule ^ index.php/(. *) $ index.php?controller=jump&method=jump&code=$1 [QSA]
But always can not jump, ask how should be properly configured it.
Reply to discussion (solution)
1.httpd.conf The rewrite module is turned on correctly
2. Is the configuration file you wrote valid?
I am under Ubuntu, did not find the httpd.conf file, the main configuration file only apach2.conf, and now the configuration is this.
1. In the/var/www/project/shorturl directory, create a. htaccss file with the following contents:
# Turn on rewrite engineoptions +followsymlinksrewriteengine on# more rules Belowrewriterule ^index.php/(. *) $ index.php?c ontroller=jump&method=jump&code=$1 [QSA
2. The following configuration was made in apach2.conf:
Options followsymlinks allowoverride all Require all granted
No other configuration is done. Now the problem is this:
The problem now is that each input http://localhost/project/ShortURL/index.php/149Ui3 will show no CSS style control http://localhost/project/ShortURL/ index.php content (address bar or http://localhost/project/ShortURL/index.php/149Ui3), cannot jump to http://localhost/project/ShortURL/ Index.php?controller=jump&method=jemp&code=149ui3 this address.
1.httpd.conf The rewrite module is turned on correctly
2. Is the configuration file you wrote valid?
Now, as shown in the building, sorry to reply wrong.
Problem solved, summed up:
Problem Description:
My goal is to enter the URL in the address bar:
Http://localhost/project/ShortURL/index.php/149Ui3
Automatically rewritten as
Http://localhost/project/ShortURL/index.php?controller=jump&method=jump&code=149Ui3
Solution Solutions
1. Make the following configuration in apach2.conf:
Options FollowSymLinks
AllowOverride All
Require all granted
2. In the/var/www/project/shorturl directory, create a. htaccss file with the following contents:
# Turn on rewrite engine
Rewriteengine on
# More Rules below
Rewritebase/
Rewriterule ^index.php/(. *) $ http://localhost/project/ShortURL/index.php?controller=jump&method=j ump& code=$1 [l,r=301]
written in the last
It's time to read more documents, thanks to open source China crazy snail offers ideas.