2

これは私の.htaccessファイルです:

Options +FollowSymLinks
Options -Multiviews

RewriteEngine On
RewriteBase /website/

RewriteCond %{REQUEST_FILENAME} -d [OR]
RewriteCond %{REQUEST_FILENAME} -f
RewriteRule .? - [S=20]

RewriteRule ^(.*)$ $1.php 
RewriteRule ^([a-z0-9_-]+)/([a-z0-9_-]+)(/)?$ index.php?occ=$1&cat=$2

たとえば、これらの2行が一緒に機能していません。

contact.php にアクセスする場合は、自分の URL を入力します: localhost/website/contact で動作します

ただし、url に次のように入力して location/website/index.php?occ=occasion&cat=category に移動したい場合: localhost/website/occasion/category は、最初の書き換えルールを削除した場合にのみ機能します。

しかし、それから私はもうlocalhost/website/contactに行くことができません

ここで何が欠けていますか?

4

2 に答える 2

0
RewriteEngine on

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d

RewriteRule ^site_1/(.*)$ site_1/index.php?/$1 [L]
RewriteRule ^site_2/(.*)$ site_2/index.php?/$1 [L]

何千ものサイトを持たないサイトのように、構造が

/home/site1, /home/site2

リンクはhttp://yourdomain.com/medical & http://yourdomain.com/entertainmentのようになります

于 2014-02-22T02:44:59.713 に答える