1

次の htaccess をどのように変更する必要がありますか。

RewriteEngine On
RewriteRule ^([^/]*)/([^/]*)\.html$ /index.php?administration=$1&pid=$2 [L]

のような URL だけでなく影響を与えるには

www.example.com/administration/modules //this is working allready

しかし、fe のような URL も

www.example.com/upload/category

あるいは単に

www.example.com/news

よろしくお願いします、ジェイデン

4

1 に答える 1

1

Enable mod_rewrite and .htaccess through httpd.conf and then put this code in your .htaccess under DOCUMENT_ROOT directory:

Options +FollowSymLinks -MultiViews
# Turn mod_rewrite on
RewriteEngine On
RewriteBase /

## If the request is for a valid file
RewriteCond %{REQUEST_FILENAME} -f [OR]
## If the request is for a valid link
RewriteCond %{REQUEST_FILENAME} -l
## don't do anything
RewriteRule ^ - [L]

RewriteRule ^([^/]+)/([^/]+)/?$ /index.php?$1=$1&pid=$2 [L,QSA]
RewriteRule ^([^/]+)/?$ /index.php?pid=$1 [L,QSA]
于 2012-06-05T21:00:33.200 に答える