Organizational Research By

Surprising Reserch Topic

apache php mod rewrite seems not to work properly using -'php,apache,.htaccess,mod-rewrite,virtualhost'


apache php mod rewrite seems not to work properly  using -'php,apache,.htaccess,mod-rewrite,virtualhost'

i'm working with a PHP application in an Apache server. I want to use the rewrite php module to transform all the urls links like the following example:  www.mysite.com/home.php ---> www.mysite.com/home

The problem is that the module is loading and functioning only for the first rule (home-->home.php), all the others rules are ignored.

I can't understand where is the problem

This is my .htaccess file

<IfModule mod_rewrite.c>
Options +FollowSymlinks
# Options +SymLinksIfOwnerMatch
Options +FollowSymlinks
RewriteEngine On
# RewriteBase /
</IfModule>



# Option 1:
# Rewrite "www.example.com -> example.com".
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^ http://%1%{REQUEST_URI} [R=301,L]
</IfModule>



RewriteRule      ^home$                          index.php                    [NC,L]
RewriteRule      ^ga$                    ga.php                         [NC,L]
RewriteRule          ^info                       info.php                                       [NC,L]
RewriteRule      ^ecosoc                     ecosoc.php                   [NC,L]
RewriteRule      ^sc                         sc.php                       [NC,L]
RewriteRule      ^icj                        icj.php                      [NC,L]
#RewriteRule     ^gallery$                  gallery.php                  [NC,L]
#RewriteRule     ^archive$                  archive/index.php            [NC,L]
RewriteRule      ^contact$                   contact.php                  [NC,L]


#RewriteRule      ^login$                    login.php                    [NC,L]


RewriteRule      ^registration$             registration.php                  [NC,L]
RewriteRule      ^delegate$                 delegate.php                      [NC,L]
RewriteRule      ^delegate/success$         delegate.php?result=success       [NC,L]
RewriteRule      ^delegate/error$           delegate.php?result=error         [NC,L]

RewriteRule      ^iscrizioni/confirm/([a-z]*)$    confirm_registration.php?action=$1  [NC,L]
RewriteRule      ^iscrizioni/confirm/user/(.*)$   confirm_registration.php?action=confirm&code=$1  [NC,L]



#RewriteRule      ^course$                   course.php?e=error               [NC,L]
RewriteRule      ^staff$                    staff.php                        [NC,L]
RewriteRule      ^staff/success$            staff.php?result=success         [NC,L]

#RewriteRule      ^schoolarea/$              http://school.rimun.com          [NC,L]


and this is my vhost .conf file

#
# public-website
#

<Directory  /var/www/public-website>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride all

    Require all granted
</Directory>

<VirtualHost *:80>
    DirectoryIndex index.php  #settare al nome file da aprire all'accesso al sito
    ServerName sociall.local
    ServerAdmin croce.1546488@studenti.uniroma1.it
    DocumentRoot /var/www/public-website/

    ErrorLog /var/www/public-website/error.log
    #CustomLog /var/www/html/sociall/log/access.log combined
</VirtualHost>


Thank you in advice for your support.
    
asked Sep 7, 2015 by rajesh
0 votes
17 views



Related Hot Questions



Government Jobs Opening


...