IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Apache Discussion :

Créer une 301 avec des paramètres techniques


Sujet :

Apache

  1. #1
    Membre régulier
    Homme Profil pro
    Ingénieur d'études en développements techniques
    Inscrit en
    Novembre 2005
    Messages
    244
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur d'études en développements techniques
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2005
    Messages : 244
    Points : 117
    Points
    117
    Par défaut Créer une 301 avec des paramètres techniques
    Bonjour,

    Je rencontre des difficultés pour créer une 301 : je suis en train d'effectuer des tests : j'ai besoin de faire une redirection 301 d'une URL qui contient des paramètres techniques, mais je ne connais pas la syntaxe exacte car ce n'est pas pris en compte.

    Voici ce que j'aimerai faire

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    redirect 301 http://www.monsite.com/fr/url_depart.html?___store=fr&___from_store=es http://www.monsite.com/fr/url_arrivee.html
    Mais ce n'est pas pris en compte, si je supprime les paramètres techniques, cela fonctionne très bien.
    D'avance merci pour votre aide.

  2. #2
    Membre éprouvé Avatar de Marc3001
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Février 2008
    Messages
    829
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Morbihan (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Février 2008
    Messages : 829
    Points : 1 275
    Points
    1 275
    Par défaut
    Dixit la doc, la première url doit débuter par un slash.

    Je ne vois pas de notion de paramètre dans l'url... Il se peux que via la directive redirect, les paramètres ne soient pas pris en compte...

    Essaie avec une rewriterule en jouant avec des rewritecond sur les paramètres.
    Le logiciel, c'est comme le sexe, c'est meilleur quand c'est libre.

    Linus Torvalds

  3. #3
    Membre régulier
    Homme Profil pro
    Ingénieur d'études en développements techniques
    Inscrit en
    Novembre 2005
    Messages
    244
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur d'études en développements techniques
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2005
    Messages : 244
    Points : 117
    Points
    117
    Par défaut
    Bonjour Marc3001

    Merci pour ta réponse, j'ai un gros problème, peut-être as tu une solution : aucune redirection n'est prise en compte, mais par contre, le fichier .htaccess est pris en compte, car quand je fais exprès de faire une faute dans le fichier, j'ai bien une erreur 500. Je suis un serveur Debian, il s'agit de mon serveur de DEV, mon serveur de PROD, quant à lui, prends bien compte les redirection 301.
    J'ai autorisé l'Override, etc, je ne sais vraiment pas à quoi c'est dû, d'avance merci pour ton aide.

  4. #4
    Membre éprouvé Avatar de Marc3001
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Février 2008
    Messages
    829
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Morbihan (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Février 2008
    Messages : 829
    Points : 1 275
    Points
    1 275
    Par défaut
    Ca sera plus simple d'investiguer avec le contenu du fichier httpd.conf et du .htaccess sous les yeux ;-)
    Le logiciel, c'est comme le sexe, c'est meilleur quand c'est libre.

    Linus Torvalds

  5. #5
    Membre régulier
    Homme Profil pro
    Ingénieur d'études en développements techniques
    Inscrit en
    Novembre 2005
    Messages
    244
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur d'études en développements techniques
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2005
    Messages : 244
    Points : 117
    Points
    117
    Par défaut
    Voici mon fichier apache2.conf :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
     
    #
    # Based upon the NCSA server configuration files originally by Rob McCool.
    #
    # This is the main Apache server configuration file.  It contains the
    # configuration directives that give the server its instructions.
    # See http://httpd.apache.org/docs/2.2/ for detailed information about
    # the directives.
    #
    # Do NOT simply read the instructions in here without understanding
    # what they do.  They're here only as hints or reminders.  If you are unsure
    # consult the online docs. You have been warned.  
    #
    # The configuration directives are grouped into three basic sections:
    #  1. Directives that control the operation of the Apache server process as a
    #     whole (the 'global environment').
    #  2. Directives that define the parameters of the 'main' or 'default' server,
    #     which responds to requests that aren't handled by a virtual host.
    #     These directives also provide default values for the settings
    #     of all virtual hosts.
    #  3. Settings for virtual hosts, which allow Web requests to be sent to
    #     different IP addresses or hostnames and have them handled by the
    #     same Apache server process.
    #
    # Configuration and logfile names: If the filenames you specify for many
    # of the server's control files begin with "/" (or "drive:/" for Win32), the
    # server will use that explicit path.  If the filenames do *not* begin
    # with "/", the value of ServerRoot is prepended -- so "foo.log"
    # with ServerRoot set to "/etc/apache2" will be interpreted by the
    # server as "/etc/apache2/foo.log".
    #
     
    ### Section 1: Global Environment
    #
    # The directives in this section affect the overall operation of Apache,
    # such as the number of concurrent requests it can handle or where it
    # can find its configuration files.
    #
     
    #
    # ServerRoot: The top of the directory tree under which the server's
    # configuration, error, and log files are kept.
    #
    # NOTE!  If you intend to place this on an NFS (or otherwise network)
    # mounted filesystem then please read the LockFile documentation (available
    # at <URL:http://httpd.apache.org/docs/2.2/mod/mpm_common.html#lockfile>);
    # you will save yourself a lot of trouble.
    #
    # Do NOT add a slash at the end of the directory path.
    #
    #ServerRoot "/etc/apache2"
     
    #
    # The accept serialization lock file MUST BE STORED ON A LOCAL DISK.
    #
    LockFile ${APACHE_LOCK_DIR}/accept.lock
     
    #
    # PidFile: The file in which the server should record its process
    # identification number when it starts.
    # This needs to be set in /etc/apache2/envvars
    #
    PidFile ${APACHE_PID_FILE}
     
    #
    # Timeout: The number of seconds before receives and sends time out.
    #
    Timeout 300
     
    #
    # KeepAlive: Whether or not to allow persistent connections (more than
    # one request per connection). Set to "Off" to deactivate.
    #
    KeepAlive On
     
    #
    # MaxKeepAliveRequests: The maximum number of requests to allow
    # during a persistent connection. Set to 0 to allow an unlimited amount.
    # We recommend you leave this number high, for maximum performance.
    #
    MaxKeepAliveRequests 100
     
    #
    # KeepAliveTimeout: Number of seconds to wait for the next request from the
    # same client on the same connection.
    #
    KeepAliveTimeout 15
     
    ##
    ## Server-Pool Size Regulation (MPM specific)
    ## 
     
    # prefork MPM
    # StartServers: number of server processes to start
    # MinSpareServers: minimum number of server processes which are kept spare
    # MaxSpareServers: maximum number of server processes which are kept spare
    # MaxClients: maximum number of server processes allowed to start
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_prefork_module>
        StartServers          5
        MinSpareServers       5
        MaxSpareServers      10
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
     
    # worker MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadLimit: ThreadsPerChild can be changed to this maximum value during a
    #              graceful restart. ThreadLimit can only be changed by stopping
    #              and starting Apache.
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_worker_module>
        StartServers          2
        MinSpareThreads      25
        MaxSpareThreads      75 
        ThreadLimit          64
        ThreadsPerChild      25
        MaxClients          150
        MaxRequestsPerChild   0
    </IfModule>
     
    # event MPM
    # StartServers: initial number of server processes to start
    # MaxClients: maximum number of simultaneous client connections
    # MinSpareThreads: minimum number of worker threads which are kept spare
    # MaxSpareThreads: maximum number of worker threads which are kept spare
    # ThreadsPerChild: constant number of worker threads in each server process
    # MaxRequestsPerChild: maximum number of requests a server process serves
    <IfModule mpm_event_module>
        StartServers          2
        MaxClients          150
        MinSpareThreads      25
        MaxSpareThreads      75 
        ThreadLimit          64
        ThreadsPerChild      25
        MaxRequestsPerChild   0
    </IfModule>
     
    # These need to be set in /etc/apache2/envvars
    User ${APACHE_RUN_USER}
    Group ${APACHE_RUN_GROUP}
     
    #
    # AccessFileName: The name of the file to look for in each directory
    # for additional configuration directives.  See also the AllowOverride
    # directive.
    #
     
    AccessFileName .htaccess
     
    #
    # The following lines prevent .htaccess and .htpasswd files from being 
    # viewed by Web clients. 
    #
    <Files ~ "^\.ht">
        Order allow,deny
        Deny from all
        Satisfy all
    </Files>
     
    #
    # DefaultType is the default MIME type the server will use for a document
    # if it cannot otherwise determine one, such as from filename extensions.
    # If your server contains mostly text or HTML documents, "text/plain" is
    # a good value.  If most of your content is binary, such as applications
    # or images, you may want to use "application/octet-stream" instead to
    # keep browsers from trying to display binary files as though they are
    # text.
    #
    DefaultType text/plain
     
     
    #
    # HostnameLookups: Log the names of clients or just their IP addresses
    # e.g., www.apache.org (on) or 204.62.129.132 (off).
    # The default is off because it'd be overall better for the net if people
    # had to knowingly turn this feature on, since enabling it means that
    # each client request will result in AT LEAST one lookup request to the
    # nameserver.
    #
    HostnameLookups Off
     
    # ErrorLog: The location of the error log file.
    # If you do not specify an ErrorLog directive within a <VirtualHost>
    # container, error messages relating to that virtual host will be
    # logged here.  If you *do* define an error logfile for a <VirtualHost>
    # container, that host's errors will be logged there and not here.
    #
    ErrorLog ${APACHE_LOG_DIR}/error.log
     
    #
    # LogLevel: Control the number of messages logged to the error_log.
    # Possible values include: debug, info, notice, warn, error, crit,
    # alert, emerg.
    #
    LogLevel warn
     
    # Include module configuration:
    Include mods-enabled/*.load
    Include mods-enabled/*.conf
     
    # Include all the user configurations:
    Include httpd.conf
     
    # Include ports listing
    Include ports.conf
     
    #
    # The following directives define some format nicknames for use with
    # a CustomLog directive (see below).
    # If you are behind a reverse proxy, you might want to change %h into %{X-Forwarded-For}i
    #
    LogFormat "%v:%p %h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
    LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %O" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent
     
    # Include of directories ignores editors' and dpkg's backup files,
    # see README.Debian for details.
     
    # Include generic snippets of statements
    Include conf.d/
     
    # Include the virtual host configurations:
    Include sites-enabled/

  6. #6
    Membre régulier
    Homme Profil pro
    Ingénieur d'études en développements techniques
    Inscrit en
    Novembre 2005
    Messages
    244
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur d'études en développements techniques
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2005
    Messages : 244
    Points : 117
    Points
    117
    Par défaut
    J'ai enquêté en profondeur et réalisé plusieurs tests :
    En fait les redirections 301 fonctionnent bien sur d'autres sites, hébergés sur le même serveur, donc le problème ne provient pas, contrairement à ce que je pensais du serveur Debian, par contre le fichier .htaccess en question fonctionne parfaitement sur le même site hébergé sur la version PROD, par contre sur le même site en version DEV, les 301 ne fonctionnent pas. C'est ce qui m'a fait penser à un problème de serveur. Je continue à creuser, j'espère une aide sur ce forum, d'avance merci.

  7. #7
    Membre régulier
    Homme Profil pro
    Ingénieur d'études en développements techniques
    Inscrit en
    Novembre 2005
    Messages
    244
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur d'études en développements techniques
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2005
    Messages : 244
    Points : 117
    Points
    117
    Par défaut
    Voici le vhost
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
     
    Alias /monsite /var/www/monsite 
    <Directory /var/www/monsite >
       DirectoryIndex index.html index.php
       AllowOverride All
       Order allow,deny
       Allow from all
    </Directory>
    Je sais pas si ça peut servir

  8. #8
    Membre régulier
    Homme Profil pro
    Ingénieur d'études en développements techniques
    Inscrit en
    Novembre 2005
    Messages
    244
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : France, Paris (Île de France)

    Informations professionnelles :
    Activité : Ingénieur d'études en développements techniques
    Secteur : High Tech - Multimédia et Internet

    Informations forums :
    Inscription : Novembre 2005
    Messages : 244
    Points : 117
    Points
    117
    Par défaut Voici le fichier .htaccess en question
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
     
    <IfModule mod_rewrite.c>
    ############################################
    ## enable rewrites
    Options +FollowSymLinks
    RewriteEngine on
     
    ############################################
    ## workaround for HTTP authorization
    ## in CGI environment
    RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
    RewriteBase /monsite/
    Redirect permanent /old_page.html /new_page.html
     
    ############################################
    ## always send 404 on missing files in these folders
    RewriteCond %{REQUEST_URI} !^/(media|skin|js)/
     
    ############################################
    ## never rewrite for existing files, directories and links
     
        RewriteCond %{REQUEST_FILENAME} !-f
        RewriteCond %{REQUEST_FILENAME} !-d
        RewriteCond %{REQUEST_FILENAME} !-l
     
    ############################################
    ## rewrite everything else to index.php
     RewriteRule .* index.php [L]
    </IfModule>
     
    ############################################
    ## Prevent character encoding issues from server overrides
    ## If you still have problems, use the second line instead
     
        #AddDefaultCharset Off
        AddDefaultCharset UTF-8
     
     
    ############################################
    ## Optimisation performances
    ##
    # BEGIN Expire headers
    # MOD_DEFLATE COMPRESSION
       SetOutputFilter DEFLATE
       AddOutputFilterByType DEFLATE text/html text/css text/plain text/xml application/x-javascript application/x-httpd-php
       #Pour les navigateurs incompatibles
       BrowserMatch ^Mozilla/4 gzip-only-text/html
       BrowserMatch ^Mozilla/4\.0[678] no-gzip
       BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
       BrowserMatch \bMSI[E] !no-gzip !gzip-only-text/html
       #ne pas mettre en cache si ces fichiers le sont d?j?
       SetEnvIfNoCase Request_URI \.(?:gif|jpe?g|png)$ no-gzip
       #les proxies doivent donner le bon contenu
       Header append Vary User-Agent env=!dont-vary
     
       # BEGIN Expire headers
       <IfModule mod_expires.c>
        ExpiresActive On
        ExpiresDefault "access plus 7200 seconds"
        ExpiresByType image/jpg "access plus 2592000 seconds"
        ExpiresByType image/jpeg "access plus 2592000 seconds"
        ExpiresByType image/png "access plus 2592000 seconds"
        ExpiresByType image/gif "access plus 2592000 seconds"
        AddType image/x-icon .ico
        ExpiresByType image/ico "access plus 2592000 seconds"
        ExpiresByType image/icon "access plus 2592000 seconds"
        ExpiresByType image/x-icon "access plus 2592000 seconds"
        ExpiresByType text/css "access plus 2592000 seconds"
        ExpiresByType text/javascript "access plus 2592000 seconds"
        ExpiresByType text/html "access plus 7200 seconds"
        ExpiresByType application/xhtml+xml "access plus 7200 seconds"
        ExpiresByType application/javascript A259200
        ExpiresByType application/x-javascript "access plus 2592000 seconds"
        ExpiresByType application/x-shockwave-flash "access plus 2592000 seconds"
       </IfModule>
       # END Expire headers
     
       # BEGIN Cache-Control Headers
       <IfModule mod_headers.c>
        <FilesMatch "\\.(ico|jpe?g|png|gif|swf|gz|ttf)$">
          Header set Cache-Control "max-age=2592000, public"
        </FilesMatch>
        <FilesMatch "\\.(css)$">
          Header set Cache-Control "max-age=2592000, public"
        </FilesMatch>
        <FilesMatch "\\.(js)$">
          Header set Cache-Control "max-age=2592000, private"
        </FilesMatch>
       <filesMatch "\\.(html|htm)$">
          Header set Cache-Control "max-age=7200, public"
       </filesMatch>
       # Disable caching for scripts and other dynamic files
       <FilesMatch "\.(pl|php|cgi|spl|scgi|fcgi)$">
          Header unset Cache-Control
       </FilesMatch>
       </IfModule>
       # END Cache-Control Headers
     
       # KILL THEM ETAGS
       Header unset ETag
       FileETag none
     
       # protect the htaccess file
       <files .htaccess>
          order allow,deny
          deny from all
       </files>
     
       # protection de la lecture des repertoires
       Options -Indexes
    ## Fin Optimisation
    ############################################   
     
    ############################################
    ## By default allow all access
     
    Order allow,deny
    Allow from all

  9. #9
    Membre éprouvé Avatar de Marc3001
    Homme Profil pro
    Ingénieur systèmes et réseaux
    Inscrit en
    Février 2008
    Messages
    829
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 40
    Localisation : France, Morbihan (Bretagne)

    Informations professionnelles :
    Activité : Ingénieur systèmes et réseaux

    Informations forums :
    Inscription : Février 2008
    Messages : 829
    Points : 1 275
    Points
    1 275
    Par défaut
    Dans ton .htaccess, je ne vois qu'un redirect permanent. Il fonctionne celui-là ?
    Tu places où le redirect de ton premier post dans ton fichier ?
    Le logiciel, c'est comme le sexe, c'est meilleur quand c'est libre.

    Linus Torvalds

Discussions similaires

  1. Comment créer une vue avec des paramètres (objets) ?
    Par Ryu2000 dans le forum Eclipse Platform
    Réponses: 25
    Dernier message: 12/12/2012, 13h11
  2. Réponses: 2
    Dernier message: 10/10/2008, 00h37
  3. [FLASH MX2004] Lancer une anim avec des paramètres ??
    Par gchanteux dans le forum Flash
    Réponses: 4
    Dernier message: 23/03/2005, 17h49
  4. Erreur sur une fonction avec des paramètres
    Par Elois dans le forum PostgreSQL
    Réponses: 2
    Dernier message: 05/05/2004, 21h00
  5. créer un noeuds avec des paramétres
    Par Toxine77 dans le forum XMLRAD
    Réponses: 5
    Dernier message: 21/01/2003, 16h11

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo