我想将网址从:
http://subdomain.domain.com/page/
tohttp://subdomain.domain.com/?page=pagename
和also:
http://domain.com/page/
to更改为http://domain.com/?page=pagename
虽然没有取得多大成功。
到目前为止,这是我的 htaccess 文件 [更新]
Options +FollowSymlinks -MultiViews
RewriteEngine On
RewriteBase /
# Remove 'www'
RewriteCond %{HTTP_HOST} ^www\.(.+)$ [NC]
RewriteRule ^(.*)$ http://%1/$1 [R=301,L]
# Add slashes
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_URI} !index.php
RewriteCond %{REQUEST_URI} !(.*)/$
RewriteRule ^(.*)$ http://resolutiongaming.com/$1/ [L,R=301]
# Subdomain redirect
RewriteRule ^/(webdev)/(.*)$ http://webdev.resolutiongaming.com/$1 [R=301,L]
RewriteRule ^/(artwork)/(.*)$ http://artwork.resolutiongaming.com/$1 [R=301,L]
RewriteRule ^/(music)/(.*)$ http://music.resolutiongaming.com/$1 [R=301,L]
# Search engine optimization
RewriteRule ([a-zA-Z]+)/$ ?page=$1
我使用RewriteRule ^([a-zA-Z]+)/$ ?page=$1
的似乎适用于域 url 但不适用于子域。任何帮助,将不胜感激。