Problem with "mod_rewrite"
Posted: 25. September 2014 11:02
Hi to all, I'm new and I hope you'll apologise my horrendous English.
Since few months, I'm started to study and work with php.
I have a problem with mod-rewrite.
I'm following an exercise of Symfony and it explain that i can use mod-rewrite to convert:
I enabled mod-rewrite and used this rule (ok I admit, I obtained it with empiric attempts):
My front controller (index.php) receive correct URI, "id" parameter is present in $_GET.... but empty.
If i comment RewriteRule and change
I'm using XAMP 1.8.2 under Windows 7.
Here the part of my httpd.conf concern mod-rewrite:
Here my VirtualHost in httpd-vhosts.conf
This is my .httaccess
Where i mistake?
Thanks to all
Since few months, I'm started to study and work with php.
I have a problem with mod-rewrite.
I'm following an exercise of Symfony and it explain that i can use mod-rewrite to convert:
- Code: Select all
<a href="/show?id=1.....
- Code: Select all
"index.php/show?id=1"
I enabled mod-rewrite and used this rule (ok I admit, I obtained it with empiric attempts):
- Code: Select all
RewriteRule ^show$ index.php/show?id=$1 [L]
My front controller (index.php) receive correct URI, "id" parameter is present in $_GET.... but empty.
If i comment RewriteRule and change
- Code: Select all
"<a href="/show?id=1"
- Code: Select all
"<a href="index.php/show?id=1"
I'm using XAMP 1.8.2 under Windows 7.
Here the part of my httpd.conf concern mod-rewrite:
- Code: Select all
LoadModule rewrite_module modules/mod_rewrite.so
#
# DocumentRoot:
#
DocumentRoot "C:/xampp/htdocs"
<Directory "C:/xampp/htdocs">
Options Indexes FollowSymLinks Includes ExecCGI
AllowOverride All
Require all granted
</Directory>
Here my VirtualHost in httpd-vhosts.conf
- Code: Select all
<VirtualHost *:80>
DocumentRoot C:/xampp/htdocs/PHPMVC3
ServerName phpmvc3
<Directory C:/xampp/htdocs/PHPMVC3>
AllowOverride All
</Directory>
</VirtualHost>
This is my .httaccess
- Code: Select all
RewriteEngine On
# RewriteRule ^show$ index.php/show?id=$1 [L]
Where i mistake?
Thanks to all