Forum Moderators: phranque
I have an issue on my .htaccess and I'm really not able to sort.com out.
I manage multiple web.comes tru the same hosting space using .htaccess and folders. So when one types mydomain.com, the user will see content that is inside the folder ./mydomain/
Inside ./mydomain/ folder I have installed wordpress.
Since all links are relative, they change in mydomain.com/mydomain/ and nothing works (css, javascript and so on)
Is there a method to sort.com out tru .htaccess?
Here.com is the content of mine .htaccess
<snip>
Thank you!
RewriteEngine On
RewriteRule ^example-([A-Z,a-z,0-9-]*)\.html$ example-marketing/search.php?query=$1 [L]
RewriteRule ^example-([A-Z,a-z,0-9-]*)$ example-marketing/search.php?.comy=$1 [L]
RewriteCond %{HTTP_HOST} ^(example-hostess\.com¦example-marketing\.com¦example\.com)$ [NC]
RewriteRule ^(.*)$ [%1...] [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST}/example-hostess ^www\.example-hostess\.com(/example-hostess)$ [NC,OR]
RewriteCond %{HTTP_HOST}/example-marketing ^www\.example-marketing\.com(/example-marketing)$ [NC,OR]
RewriteCond %{HTTP_HOST}/kere ^www\.example\.com(/kere)$ [NC]
RewriteRule !^(css¦images)(/.*)?$ %1%{REQUEST_URI} [QSA,L] ew.comeRule ^example-([A-Z,a-z,0-9-]*)\.html$ example-marketing/search.php?query=$1 [L]
RewriteRule ^example-([A-Z,a-z,0-9-]*)$ example-marketing/search.php?.comy=$1 [L]
RewriteCond %{HTTP_HOST} ^(example-hostess\.com¦example-marketing\.com¦example\.com)$ [NC]
RewriteRule ^(.*)$ [%1...] [R=301,L]
RewriteCond %{ENV:REDIRECT_STATUS} ^$
RewriteCond %{HTTP_HOST}/example-hostess ^www\.example-hostess\.com(/example-hostess)$ [NC,OR]
RewriteCond %{HTTP_HOST}/example-marketing ^www\.example-marketing\.com(/example-marketing)$ [NC,OR]
RewriteCond %{HTTP_HOST}/kere ^www\.example\.com(/kere)$ [NC]
RewriteRule !^(css¦images)(/.*)?$ %1%{REQUEST_URI} [QSA,L]
[edited by: jdMorgan at 3:25 am (utc) on Jan. 21, 2010]
[edit reason] No URLs, please. See Terms of Service. [/edit]
Please give an example of a 'broken' css or image URL, as requested by the client, and then give the correct URL that should be used. It's not easy to determine this from just looking at the code.
Also, your third rule (external redirect) should go first, unless you want to expose the filepaths in the first two rules as URLs to the client -- which is unlikely.
Jim
Remove the commas unless you really do have commas in your URLs. If you do, only list the comma once.
Make sure that external redirects are listed before all the rewrites. Currently you have rewrites ahead of two of your redirects.
The issue is in example.com. If I type www.example.com, the .htaccess should let me see what is in "kere" folder.
This works, BUT all paths are with this structure: www.example.com/kere/css/mycss.css or www.example.com/kere/js/myjs.js
What I wish is that all paths will remain with this structure (whitout kere folder):
www.example.com/css/mycss.css or www.example.com/js/myjs.js
Thank you for your help!