瀏覽我最近我安裝Linux上的新的網絡服務器具有典型的燈系統。我使用PhPBB作爲我的網站的基礎。
一切都在線並可從網絡外部訪問。
唯一的問題:該URL永遠不會從www.gaymerscommunity.com更改。您可以瀏覽整個測試論壇,註冊部分或網站的任何其他部分,並且始終保持相同的URL,no/index/forums/register或其他任何內容。始終只是基本網址。
我啓用了a2enmod重寫,並且我允許覆蓋apache2.conf中的所有目錄;我還很早就更改了/ etc/hosts文件以包含'127.0.0.1 gaymerscommunity.com'。
其他一切都很默認。
我真的很希望論壇上的每個帖子都有一個獨特的網址,或者至少每個論壇都有一個我可以用來引導用戶訪問相應內容的網址。
我應該從哪裏開始?
我在我的文件夾的根目錄中有一個.htaccess文件,但是我從某人那裏得到了它,這是他們的PhPBB默認.htaccess文件。所以,我只是複製它,並啓用重寫。
<IfModule mod_rewrite.c>
RewriteEngine on
#
# Uncomment the statement below if you want to make use of
# HTTP authentication and it does not already work.
# This could be required if you are for example using PHP via Apache CGI.
#
#RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization},L]
#
# The following 3 lines will rewrite URLs passed through the front controller
# to not require app.php in the actual URL. In other words, a controller is
# by default accessed at /app.php/my/controller, but can also be accessed at
# /my/controller
#
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ app.php [QSA,L]
#
# If symbolic links are not already being followed,
# uncomment the line below.
# http://anothersysadmin.wordpress.com/2008/06/10/mod_rewrite-forbidden-403-with-apache-228/
#
#Options +FollowSymLinks
</IfModule>
<IfModule mod_version.c>
<IfVersion < 2.4>
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
</IfVersion>
<IfVersion >= 2.4>
<Files "config.php">
Require all denied
</Files>
<Files "common.php">
Require all denied
</Files>
</IfVersion>
</IfModule>
<IfModule !mod_version.c>
<IfModule !mod_authz_core.c>
<Files "config.php">
Order Allow,Deny
Deny from All
</Files>
<Files "common.php">
Order Allow,Deny
Deny from All
</Files>
</IfModule>
<IfModule mod_authz_core.c>
<Files "config.php">
Require all denied
</Files>
<Files "common.php">
Require all denied
</Files>
</IfModule>
</IfModule>
您在本網站的根目錄下是否有正確的.htaccess文件? – Imdad
我在根目錄下有一個.htaccess,但我不確定它是否正確安裝。我發現另一個用戶說這是他的默認設置,我將其複製爲我自己的。 – Pinkphoenix
我在原始文章中包含.htaccess文件。 – Pinkphoenix