htaccess i doklejone zbędne parametry po przekierowaniu |
htaccess i doklejone zbędne parametry po przekierowaniu |
4.07.2019, 15:13:03
Post
#1
|
|
Grupa: Zarejestrowani Postów: 7 Pomógł: 0 Dołączył: 23.02.2010 Ostrzeżenie: (0%) |
Cześć mam mały problem i proszę o pomoc.
Otóż mój htaccess wygląda z grubsza tak RewriteEngine On RewriteBase / RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^lubieto-([a-z0-9\-\_\.]+)(/[a-z0-9\-\_\.]+)?/?$ index.php?get_wizard=TRUE&kategoria=$1&group=$2 [NC] RewriteRule ^([a-z0-9\-\_\,]+)/([a-z0-9\-\_,\/]+[^\/])/?$ index.php?get_object=TRUE&name=$2&kategoria=$1 [NC,L] RewriteCond %{HTTP_HOST} ^mojastrona.pl [nc] RewriteRule ^(.*)$ http://www.mojastrona.pl/$1 [r=301,nc] I teraz gdy chcę zrobić przekierowanie dla pojedynczych podstron w prosty sposób np. Redirect 301 /nazwa_kategorii/stara_strona /nazwa_kategorii/nowa_strona lub RedirectMatch 301 /nazwa_kategorii/stara_strona /nazwa_kategorii/nowa_strona To po przekierowaniu dokleja mi parametry z drugiego RewriteRule i adres w przeglądarce wygląda tak www.mojastrona.pl/nazwa_kategorii/nowa_strona?get_object=TRUE&name=nowa_strona&kategoria=nazwa_kategorii Jak zrobić by w adresie nie pojawiało się ?get_object............ |
|
|
8.07.2019, 08:39:03
Post
#2
|
|
Grupa: Zarejestrowani Postów: 7 Pomógł: 0 Dołączył: 23.02.2010 Ostrzeżenie: (0%) |
Dokładnie tak:
RewriteEngine On RewriteBase / RewriteCond %{HTTPS} !=on RewriteRule ^ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] RewriteCond %{REQUEST_FILENAME} !-f RewriteCond %{REQUEST_FILENAME} !-d RewriteRule ^lubieto-([a-z0-9\-\_\.]+)(/[a-z0-9\-\_\.]+)?/?$ index.php?get_wizard=TRUE&kategoria=$1&group=$2 [NC] RewriteRule ^([a-z0-9\-\_\,]+)/([a-z0-9\-\_,\/]+[^\/])/?$ index.php?get_object=TRUE&name=$2&kategoria=$1 [NC,L] RewriteCond %{HTTP_HOST} ^mojastrona.pl [nc] RewriteRule ^(.*)$ https://www.mojastrona.pl/$1 [r=301,nc] Redirect 301 /nazwa_kategorii/stara_strona /nazwa_kategorii/nowa_strona? <IfModule mod_expires.c> ExpiresActive On ExpiresDefault "access plus 1 month" ExpiresByType text/html "access plus 1 seconds" ExpiresByType image/gif "access plus 30 days" ExpiresByType image/jpeg "access plus 30 days" ExpiresByType image/png "access plus 30 days" ExpiresByType image/jpg "access plus 30 days" ExpiresByType image/svg+xml "access plus 30 days" ExpiresByType text/css "access plus 30 days" ExpiresByType text/javascript "access plus 30 days" ExpiresByType application/javascript "access plus 30 days" ExpiresByType application/x-javascript "access plus 30 days" ExpiresByType text/xml "access plus 60 minutes" </IfModule> <ifModule mod_gzip.c> mod_gzip_on Yes mod_gzip_dechunk Yes mod_gzip_item_include file .(html?|txt|css|js|php|pl)$ mod_gzip_item_include handler ^cgi-script$ mod_gzip_item_include mime ^text/.* mod_gzip_item_include mime ^application/x-javascript.* mod_gzip_item_exclude mime ^image/.* mod_gzip_item_exclude rspheader ^Content-Encoding:.*gzip.* </ifModule> |
|
|
Wersja Lo-Fi | Aktualny czas: 26.04.2024 - 16:41 |