Hello Guys, been a long time since I have used this site and in fact this maybe my first post. can anyone help me with a mod_rewrite issue?
The file structure is as follows Public files: /home/usrname/public_html
CGI BIN, where the software is running: /home/usrname/public_html/cgi-bin
Private files: /home/usrname/public_html/_private
Databases: /home/usrname/public_html/_private/data
What I would like to do is convert this to an Apache 2.4.12 .htaccess file, seemly a few changes during the SSL path are what I get hung on mainly. When you try any documents with the SSL path all I see if the _private path and not the public_html path in the html source for any file types, like, css, js images and anything else.
We also have a permissions issues, which is asking for us to login during checkout, this must be due to of of the other .htaccess settings. It should be simple, yet somehow I'm not getting the rules correctly in-line just yet.
Here are the lines of code in each .htaccess file
Public files: /home/usrname/public_html RewriteEngine On
RewriteCond %{HTTP_HOST} ^99\.00\.99\.000$
RewriteRule ^/?(.*)$ http://www.mydomain.com/$1 [R=301,L]
RewriteCond %{HTTP_HOST} ^mydomain.com$
RewriteRule ^/?(.*)$ http://www.mydomain.com/$1 [R=301,L]
RewriteCond /home/usrname/public_html/%{REQUEST_FILENAME} -f
RewriteRule ^(.+) /home/usrname/public_html/$1 [L]
RewriteCond /home/usrname/public_html/_private/%{REQUEST_FILENAME} -f
RewriteRule ^(.+) /home/usrname/public_html/_private/$1 [L]
RewriteRule ^(.+) - [PT]
DirectoryIndex home.html index.htm index.html default.htm Default.htm
Action cgi-ccd /cgi-bin/ccd.cco
AddHandler cgi-ccd html
AddHandler default-handler .gif
AddHandler default-handler .jpg
<FilesMatch "\.(inx|weo|lco|dbo|cdo|fpo|dao)">
Order Allow,Deny
Allow from env=local_ref
</FilesMatch>
<Files 403.shtml>
order allow,deny
allow from all
</Files>
We also have these .htaccess files on the account in their respective paths.
Private files: /home/usrname/public_html/_private AuthUserFile .htpasswd
AuthGroupFile /dev/null
AuthName Administrator
AuthType Basic
<limit GET>
require valid-user
</limit>
Databases: /home/usrname/public_html/_private/data AuthUserFile .htpasswd
AuthGroupFile /dev/null
AuthName Administrator
AuthType Basic
<limit GET>
require valid-user
</limit>
CGI BIN: /home/usrname/public_html/cgi-bin Options +ExecCGI
Order allow,deny
Allow from all
Perhaps there is something with the way these all work together that are the issue now in Apache 2.4+ ? Perhaps it's the permissions with calling the file from the CGI-BIN directory, I can move this if needed? The 301 redirects are fairly simple, seemly. The syntax may need changed, but they seem simple enough to program. We think there is some conflict with something like Options FollowSymLinks SymLinksIfOwnerMatch ExecCGI Includes MultiViews or some other combination; I have tried several combinations with no luck.
In the end all I'm trying to do mask the full path cgi-bin path of the software, yet provide the old path back as a 301 redirect so we do not lose any links that may be indexed and or bookmarked.
.i.e. From: http://www.example.com/cgi-bin/ccd.cco/any-document-filename.html
To: http://www.example.com/anydocumentname.html
or in SSL mode. From: https
://www.example.com/cgi-bin/ccd.cco/any-document-filename.html
To: https
://www.example.com/anydocumentname.html
Best regards and Thank You for any help...
[edited by: engine at 8:18 am (utc) on May 13, 2015] [edited by: phranque at 7:14 pm (utc) on May 19, 2015]
[edit reason] please use example.com [/edit]