0

we manage over 70 properties and each of their websites runs from the same php code with a database controlling the differences. I need to write a redirect for a specific occasion and I don't know how to create variables in .htaccess.

for example: http://www.firstproperty.com/banquet becomes http://banquet.firstproperty.com and http://www.secondproperty.com/banquet becomes http://banquet.secondproperty.com

I am not sure if I should do this as a "redirect" or a "RewriteCond/RewriteRule"

This is my .htaccess now ( it removes index.php from codeigniter friendly urls )

DirectoryIndex index.php

redirect /joinTeam.php /index.php/prop/join_team

RewriteEngine on
RewriteCond $1 !^(index\.php|images|css|js|robots\.txt|favicon\.ico)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ ./index.php/$1 [L,QSA]

RewriteCond %{HTTP_HOST} !^www\. [NC]
RewriteRule (.*) http://www.%{HTTP_HOST}/$1 [R=301,L]
4

1 回答 1

0

不是子域吗?在我看来,你应该进入 httpd.conf 而不是 htaccess 来管理它。还是我错了?在这里稍等一下以获得更多的专业意见。已经在这里完成了一些工作,它可能会对您有所帮助:如何在 apache(xampp) 服务器中创建子域?希望能帮助到你。

NameVirtualHost 127.0.0.1:80
<VirtualHost *:80>
<Directory /banquet>
    Options FollowSymLinks Indexes
    AllowOverride All
    Order deny,allow
    allow from All
</Directory>
ServerName banquet.firstproperty.com/
ServerAlias www.banquet.firstproperty.com/
DocumentRoot /banquet
</VirtualHost>
于 2013-05-27T10:26:15.683 回答