Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

 
Reply to this topicStart new topic
> [PHP][Access]Dodanie dwóch linijek do pliku hataccess
kamil9012
post
Post #1





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 7.02.2008

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


Do pliku hataccess chciałbym dodać 2 linijki kodu, który odpowiada za przekierowanie złodziejaszków treści z RSS na inny adres. Kod który za to odpowiada to:
  1. RewriteCond %{REMOTE_ADDR} ^31.170.160.99$
  2. RewriteRule ^feed$ <a href="http://porn.hu/rss.xml" target="_blank">http://porn.hu/rss.xml</a> [R=301,L]


Dodałem go w ten sposób:
  1. # BEGIN WordPress
  2. <IfModule mod_rewrite.c>
  3. RewriteEngine On
  4. RewriteBase /
  5. RewriteRule ^index\.php$ - [L]
  6. RewriteCond %{REQUEST_FILENAME} !-f
  7. RewriteCond %{REQUEST_FILENAME} !-d
  8. RewriteCond %{REMOTE_ADDR} ^31.170.160.99$
  9. RewriteRule ^feed$ <a href="http://porn.hu/rss.xml" target="_blank">http://porn.hu/rss.xml</a> [R=301,L]
  10. RewriteRule . /index.php [L]
  11. </IfModule>
  12.  
  13. # END WordPress


Czy zrobiłem to prawidłowo?

Ten post edytował kamil9012 20.09.2011, 13:42:38
Go to the top of the page
+Quote Post
erix
post
Post #2





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Nie.

Każde RewriteCond działa wyłącznie dla najbliższego RewriteRule.
Go to the top of the page
+Quote Post
kamil9012
post
Post #3





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 7.02.2008

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


o kurde... Czy jak powinno to wyglądać? (IMG:style_emoticons/default/ohno-smiley.gif)
Go to the top of the page
+Quote Post
erix
post
Post #4





Grupa: Moderatorzy
Postów: 15 467
Pomógł: 1451
Dołączył: 25.04.2005
Skąd: Szczebrzeszyn/Rzeszów




Pokombinuj i pokaż.
Go to the top of the page
+Quote Post
kamil9012
post
Post #5





Grupa: Zarejestrowani
Postów: 71
Pomógł: 0
Dołączył: 7.02.2008

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


  1.  
  2. # BEGIN WordPress
  3. <IfModule mod_rewrite.c>
  4. RewriteEngine On
  5. RewriteBase /
  6. RewriteRule ^index\.php$ - [L]
  7. RewriteCond %{REQUEST_FILENAME} !-f
  8. RewriteCond %{REQUEST_FILENAME} !-d
  9. RewriteRule . /index.php [L]
  10. RewriteCond %{REMOTE_ADDR} ^31.170.160.99$
  11. RewriteRule ^feed$ <a href="http://porn.hu/rss.xml" target="_blank">http://porn.hu/rss.xml</a> [R=301,L]
  12. </IfModule>
  13.  
  14. # END WordPress


Czyli coś takiego? Zrozumiałem, że RewriteRule nie może być jeden pod drugim, bo wtedy ten drugi nie działa.
Go to the top of the page
+Quote Post

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

 



RSS Aktualny czas: 22.08.2025 - 13:13