Welcome Guest, Not a member yet? Register   Sign In
URL rewriting on a subdomain
#1

[eluser]njr[/eluser]
Hi, I'm having a problem with my URL rewriting on a subdomain, I'm trying to access a private file in my cgi-bin folder. I've used the example exactly as it's done in this wiki: http://codeigniter.com/wiki/mod_rewrite/

But here's the problem: I've noticed that only works if I'm using it on a regular domain, such as http://www.somedomain.com. If I use that same .htaccess file on a domain like http://sub.somedomain.com, my URL rewriting works but now I can't access the contents of my cgi-bin folder. I was able to tell it's the .htaccess file because if I tried without it, everything would work, but I need the rewriting so it removes "index.php" from my URLs.

On the regular domain, I was able to access http://www.somedomain.com/cgi-bin/private/private.cgi

How can I access http://sub.somedomain.com/cgi-bin/private/private.cgi ? Thanks for the help.
#2

[eluser]pickupman[/eluser]
Usually a subdomain is in another subfolder below the document root. Should you have to traverse up the document tree to get back to root? Or where is your subdomain pointing to?
#3

[eluser]njr[/eluser]
The subdomain is on the same level as the normal domain. I'm not sure as to why I would need a different way of URL rewriting if it's on the same level.
#4

[eluser]pickupman[/eluser]
What happens then if you create a rewrite condition to do nothing if it matches private?
Code:
RewriteCond $1 !^(private\.cgi)
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]

The first line should be necessary as it is a real file, but worth a shot. Also, try removing RewriteBase / and see if that helps.
#5

[eluser]njr[/eluser]
That didn't work, BUT I do have a workaround. I could just put my cgi scripts on another subdomain, and run them from there since I don't have any mod_rewrites going on in there. I would still welcome a proper solution though. Thanks for the help.




Theme © iAndrew 2016 - Forum software by © MyBB