Forum Moderators: phranque

Message Too Old, No Replies

.htaccess / domain aliases

getting mod rewrite to work on domain aliases

         

StrobeNet

8:38 pm on Jan 8, 2007 (gmt 0)

10+ Year Member



Hi,
I have the following situation setup on our local server.
have a website called example.co.nz which uses wordpress.
I have got the site working fine on the local address "example.ourserver" using the following htaccess...

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

The problem is I need the site to work on another local address "anothersite.ourserver/example" which is an alias which points to the original example site.

Can anyone offer any suggestions or help as to what I will need to change?

thanks in advance

[edited by: jdMorgan at 9:39 pm (utc) on Jan. 8, 2007]
[edit reason] Examplified - Please see Terms of Service. [/edit]

jdMorgan

9:43 pm on Jan 8, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



It's not clear what your setup is, but this sounds more like a DNS issue than a mod_rewrite issue.

Is anothersite.ourserver the same virtual host as example.ourserver, or is it a separate server?

Jim

StrobeNet

8:29 pm on Jan 11, 2007 (gmt 0)

10+ Year Member



I have made some progress with this problem.
Where I am at now is I need to be able to change the rewriteBase depending on the URL. So for example, if the URL contains the string "sslserver", then the rewriteBase should be /oursite/, if it does not then the rewriteBase should be /.

Do you know if there is any way to do this?

jdMorgan

11:16 pm on Jan 11, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



No, there is no way to do that. But you can set up two separate rules, and simply put the "rewritebase" path into the rules themselves.

Jim

StrobeNet

8:00 pm on Jan 14, 2007 (gmt 0)

10+ Year Member



Could you possibly post a sample code for that? I am a bit new at this.
Thanks for your replies and help as well jdMorgan.