Welcome Guest, Not a member yet? Register   Sign In
htaccess rules for .com and .ca
#1

[eluser]Rob Rightmyer[/eluser]
We have been testing a newly developed CodeIgniter page on our site which is a .COM domain name. We also own the .CA version of that domain name and all .CA requests actually point the the same directories and files on our server. (We do not have two versions of the site. )

Our problem is that when we point to the CodeIgniter page at .CA, we get a "forbidden" error message. We are using at htaccess file currently with the following code:

RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]

Can this issue be resolved with htaccess or is there another way to fix this?
#2

[eluser]Rob Rightmyer[/eluser]
Correction to my original post.

By removing the htaccess file in the root of my CodeIgniter install directory, the "forbidden" error goes away when I access the .CA version of the page.

Isn't the htaccess file recommended practice or even required if you do not want index.php to appear in your URLs?
#3

[eluser]Rob Rightmyer[/eluser]
In removing the htaccess file in my last reply, this was testing a CI version that was installed in a subdirectory using only a single controller. While this worked, our original problem remains.

So, is it possible to modify htaccess to allow .COM and .CA access to a CodeIgniter page? Currently .COM access works but .CA yields a "Forbidden" error.
#4

[eluser]Sean Murphy[/eluser]
Just a quick question that's kinda off-topic: is there a reason why you don't have the .ca domain redirect to the .com one?

Now, are you accessing CI like this?: http://example.com/cidirectory/ AND http://example.ca/cidirectory/
It may be that you need to set the RewriteBase to /cidirectory/

Would you mind pasting the lines from the Apache error log when you get a 403 error. Also, your vhost config would be helpful.
#5

[eluser]Rob Rightmyer[/eluser]
Quote:Just a quick question that's kinda off-topic: is there a reason why you don't have the .ca domain redirect to the .com one?


The main reason we don't use a redirect is because we have an online store that displays US dollar pricing for .COM and CA dollar pricing for .CA. We also display a slightly different header graphic for .CA to help set its branding apart.

Quote:Now, are you accessing CI like this?: http://example.com/cidirectory/ AND http://example.ca/cidirectory/
Yes exactly.

Quote:It may be that you need to set the RewriteBase to /cidirectory/

I tried adding "RewriteBase /cidirectory/" to my htaccess file and had the same result.

Quote:Would you mind pasting the lines from the Apache error log when you get a 403 error. Also, your vhost config would be helpful.

I will check into this.




Theme © iAndrew 2016 - Forum software by © MyBB