Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [inne][PHP]Jak htaccess rewrite?
goartur
post
Post #1





Grupa: Zarejestrowani
Postów: 233
Pomógł: 27
Dołączył: 19.10.2014

Ostrzeżenie: (0%)
-----


ROZWIAZANIE:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?page=$1

Moze mi ktos pomoc? Probowalem przepisac url z uzyciem mod rewrite, aby link :

www.strona.pl/index.php?page=home przepisac na www.strona.pl/home , lecz mialem bledy moze mi ktos pokazac jak to zrobic?

Mam teraz cos takiego:

  1. RewriteEngine On
  2. RewriteRule ^([^/]*)\.html$ /?page=$1 [L]


Lecz wtedy otrzymuje takie cos : index.php/home
A tego nie chce

Ten post edytował goartur 18.12.2015, 20:57:28
Go to the top of the page
+Quote Post
trueblue
post
Post #2





Grupa: Zarejestrowani
Postów: 6 806
Pomógł: 1828
Dołączył: 11.03.2014

Ostrzeżenie: (0%)
-----


Kod
RewriteCond %{REQUEST_URI} ^/(.+)
RewriteRule ^(.*)$ /index.php?page=%1


--------------------
Go to the top of the page
+Quote Post

Reply to this topicStart new topic
1 Użytkowników czyta ten temat (1 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 19.08.2025 - 14:16