Có một số cách để làm điều đó.
Bạn có thể sử dụng mod-rewrite để tua lại foo đến foo.php để yêu cầu /thanh được xử lý bởi /bar.php.
Sandaimespaceman tại Gmail Dot Com ¶
Sandaimespaceman tại Gmail Dot Com ¶
Sandaimespaceman tại Gmail Dot Com ¶
Sandaimespaceman tại Gmail Dot Com ¶
JTW90210 ¶
Bryce Nesbitt tại rõ ràng.com
Ryan ¶
10 năm trước
# Make PHP code look like other code types AddType application/x-httpd-php .asp .py .pl
Omolewastephen tại Gmail Dot Com ¶
4 năm trước
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t
STH tại Panix Dot Com ¶
Raz ¶
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html
14 năm trước
# Make PHP code look like unknown types
AddType application/x-httpd-php .bop .foo .133t
17 ¶
Không thể ẩn hoàn toàn mã nguồn PHP vì nó là ngôn ngữ được giải thích, nhưng có một vài lựa chọn thay thế có thể: sử dụng mã obfuscator để làm cho mã nguồn khó đọc. Sử dụng bộ bảo vệ mã hoặc bộ mã hóa.
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
.htaccess:
RewriteEngine on
# Rewrite /foo/bar to /foo/bar.php
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Return 404 if original request is /foo/bar.php
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Một tùy chọn khác, nếu bạn muốn thực hiện việc viết lại URL của mình hoàn toàn PHP, là đặt các quy tắc viết lại để hướng tất cả các yêu cầu đến một tập lệnh duy nhất. Một lợi thế lớn của điều này, là bạn có thể lưu trữ mã của mình trong một khu vực không thể truy cập được đối với Apache và chỉ có tập lệnh URL của bạn mới cần phải được Apache truy cập. ¶
Nói chung, bảo mật bằng cách tối nghĩa là một trong những hình thức bảo mật yếu nhất. Nhưng trong một số trường hợp, mỗi chút bảo mật thêm là mong muốn.
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t1
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t2
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t3
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t4
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Một vài kỹ thuật đơn giản có thể giúp che giấu PHP, có thể làm chậm một kẻ tấn công đang cố gắng khám phá những điểm yếu trong hệ thống của bạn. Bằng cách đặt expose_php thành off
trong tệp php.ini của bạn, bạn giảm lượng thông tin có sẵn cho họ. ¶
18 năm trước
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t6
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t7
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Simon tại carbontweledesign dot co dot uk ¶ ¶
16 năm trước
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t9
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html0
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html1
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html2
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html3
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html4
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html5
PHP tại vfmedia dot de ¶ ¶
JTW90210 ¶
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html6
Bryce Nesbitt tại rõ ràng.com ¶
18 năm trước
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html7
# Make all PHP code look like HTML AddType application/x-httpd-php .htm .html8
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Simon tại carbontweledesign dot co dot uk ¶ ¶
16 năm trước
off
0
off
1
off
2
off
3
off
4
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
PHP tại vfmedia dot de ¶ ¶
20 năm trước
off
6
off
7
off
8
off
9
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
PHP tại net dot người dùng ¶ ¶
JTW90210 ¶
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
1
Một vài kỹ thuật đơn giản có thể giúp che giấu PHP, có thể làm chậm một kẻ tấn công đang cố gắng khám phá những điểm yếu trong hệ thống của bạn. Bằng cách đặt expose_php thành off
trong tệp php.ini của bạn, bạn giảm lượng thông tin có sẵn cho họ. ¶
19 năm trước
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
2
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
3
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
4
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
5
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
6
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
7
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
8
So far I haven't seen a working rewriter of /foo/bar into /foo/bar.php, so I created my own. It does work in top-level directory AND subdirectories and it doesn't need hardcoding the RewriteBase.
9
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
benjamin at sonntag dot fr ¶ ¶
17 năm trước
.htaccess:
1
.htaccess:
2
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
thông tin tại frinteractives dot com ¶ ¶
7 năm trước
.htaccess:
4
.htaccess:
5
.htaccess:
6
.htaccess:
7
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
l0rdphi1 tại liquefyr dot com ¶ ¶
19 năm trước
.htaccess:
9
RewriteEngine on
0
RewriteEngine on
1
RewriteEngine on
2
RewriteEngine on
3
RewriteEngine on
4
RewriteEngine on
5
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
m1tk4 tại hotmail dot com ¶
20 năm trước
RewriteEngine on
7
RewriteEngine on
8
RewriteEngine on
9
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
PHP tại net dot người dùng ¶ ¶
18 năm trước
# Rewrite /foo/bar to /foo/bar.php
1
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Rewrite /foo/bar to /foo/bar.php
2
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Rewrite /foo/bar to /foo/bar.php
3
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Rewrite /foo/bar to /foo/bar.php
4
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Simon tại carbontweledesign dot co dot uk ¶ ¶
16 năm trước
# Rewrite /foo/bar to /foo/bar.php
6
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Rewrite /foo/bar to /foo/bar.php
7
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Rewrite /foo/bar to /foo/bar.php
8
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Rewrite /foo/bar to /foo/bar.php
9
RewriteRule ^[[^.?]+]$ %{REQUEST_URI}.php [L]
# Return 404 if original request is /foo/bar.php
0
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# Return 404 if original request is /foo/bar.php
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
1PHP tại vfmedia dot de ¶ ¶
18 năm trước
# Return 404 if original request is /foo/bar.php
2
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# Return 404 if original request is /foo/bar.php
3
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# Return 404 if original request is /foo/bar.php
4
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# Return 404 if original request is /foo/bar.php
5
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# Return 404 if original request is /foo/bar.php
6
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# Return 404 if original request is /foo/bar.php
7
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# Return 404 if original request is /foo/bar.php
8
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# Return 404 if original request is /foo/bar.php
9
RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$"
RewriteRule .* - [L,R=404]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
0
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Simon tại carbontweledesign dot co dot uk ¶ ¶
17 năm trước
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
2
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
3
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
4
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
5
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
6
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Bryce Nesbitt tại rõ ràng.com ¶
19 năm trước
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
8
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
9
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t00
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t01
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Ryan ¶ ¶
10 năm trước
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t03
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t04
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t05
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Omolewastephen tại Gmail Dot Com ¶ ¶
4 năm trước
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t07
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t08
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t09
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t10
# NOTE! FOR APACHE ON WINDOWS: Add [NC] to RewriteCond like this:
# RewriteCond %{THE_REQUEST} "^[^ ]* .*?\.php[? ].*$" [NC]
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
STH tại Panix Dot Com ¶ ¶
20 năm trước
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t13
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t14
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t15
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Raz ¶ ¶
14 năm trước
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t17
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t18
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t19
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t20
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t21
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t22
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t23
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t24
# Make PHP code look like unknown types AddType application/x-httpd-php .bop .foo .133t0
Không thể ẩn hoàn toàn mã nguồn PHP vì nó là ngôn ngữ được giải thích, nhưng có một vài lựa chọn thay thế có thể: sử dụng mã obfuscator để làm cho mã nguồn khó đọc.Sử dụng bộ bảo vệ mã hoặc bộ mã hóa., but there are a few possible alternatives: Use a code obfuscator to make the source code difficult to read. Use a code protector or encoder.
Một tùy chọn khác, nếu bạn muốn thực hiện việc viết lại URL của mình hoàn toàn PHP, là đặt các quy tắc viết lại để hướng tất cả các yêu cầu đến một tập lệnh duy nhất.Một lợi thế lớn của điều này, là bạn có thể lưu trữ mã của mình trong một khu vực không thể truy cập được đối với Apache và chỉ có tập lệnh URL của bạn mới cần phải được Apache truy cập.set rewrite rules to direct all requests to a single script. One great advantage of this, is you can store your code in an area not accessible to Apache, and only your URL dispatching script need be Apache-accessible.