Forum Moderators: phranque
I don't know the rules/language of rewrites, I've only copy & pasted what I was told to do when I installed certian shopping cart mods.
Here is my current .htaccess that is in both www.mydomain.com and in www.test.mydomain.com
Can someone tell me what I need to do to allow me access to www.test.mydomain.com?
AddHandler fastcgi-script .fcgi
Action hs-php4-script /php.fcgi
DirectoryIndex home.php index.php index.html index.htm
RewriteEngine On
RewriteRule ^blahblah/(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteRule ^blahblah.html(.*)$ blahblah.php [L]
RewriteCond %{REQUEST_URI} !(/admin/¦/provider/)
RewriteCond %{REQUEST_FILENAME} !\.(jpg¦gif¦php)$
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.+)$ blahblah.php
Options +SymlinksIfOwnerMatch -Indexes
<IfModule mod_rewrite.c>
RewriteEngine on
RewriteBase /
RewriteCond %{HTTP_HOST} !^www\.mydomain\.com [NC]
RewriteRule ^(.*)$ [mydomain.com...] [R=301,L]
</IfModule>
I also noticed that my https doesnt work for subdomains? Is there something I can do to allow it to work? or do I need an additional certificate for subdomains?
Thanks
> I don't know the rules/language of rewrites, I've only copy & pasted what I was told to do when I installed certian shopping cart mods.
We'll be happy to help you learn enough about mod_rewrite to fix your own code, but this forum is not set up to write or fix your code for you -- There are simply too many requests, and not enough "helpers" to do that.
See the references cited in our Apache Forum Charter [webmasterworld.com]to get started.
The problems you describe all seem to originate from your last rule.
By excluding your test subdomain and requests on %{SERVER_PORT} 443, you should be able to get it working.
Also, depending on the exact meaning of all those "blahblah" URL patterns, you might be able to reduce them all to one or just a very few rules. There are many other opportunities here to improve the code and make it more robust.
Jim
So...
As far as the:
By excluding your test subdomain and requests on %{SERVER_PORT} 443, you should be able to get it working.
This is something one of the shopping cart mods had me put in for SEO & rewriting product pages to an html page for better SEO.
I tried deleting it, still no luck
I tried doing:
RewriteCond %{HTTP_HOST} !^www.test\.mydomain\.com [NC]
RewriteRule ^(.*)$ [test.mydomain.com...] [R=301,L]
Still no luck.
I have tried countless variations, no luck :(
[edited by: Kemble at 10:28 pm (utc) on Feb. 16, 2009]