![]() |
Mod_Rewrite Problem - Show How Smart You Are
i have a CMS - with a problem i haven't been able to solve. The CMS stores all the content for the various paysites/domains that use the CMS in a hidden /content directory - this content includes sample/preview content used on tours - the CMS uses PHP to get the preview content - that's alot of extra work for the server building these dynamic tour pages - under heavy traffic it will slow down tours - so I had somebody monkey around with it, so that preview images/movies no longer get pulled using the PHP script - and the solution works but it's clumsy as hell. I'm no geek so I had to get a friend to
write out the problem in geek speak - here it is mod_rewrite question --------------------------------- I have multiple domains domain1.com domain2.com etc paths are: /home/xxx/domain1.com /home/xxx/domain2.com I have a content folder in: /home/xxx/content I need to rewrite domain1.com/content/ to /home/xxx/content/ so I have this in .htaccess for each domain: RewriteEngine On RewriteRule content/(.*) /home/xxx/content/$1 [L] The problem is it doesn't work, when I go to domain1.com/content/1.jpg I get 404 error: "The requested URL /home/xxx/content/1.jpg was not found on this server." It apears to be treating the full path "/home/xxx/content/" as relative path i dunno - maybe somebody here will see where things are wrong. thanks |
the path on your server is different then the path shown in a browser
in your browser it might be something like html/index.html of your server it can be user/url/html/index.html so its likely the path in your script has to do 2 more steps like ../../ |
thanks - hope it's something simple like that.
|
Don't use Rewrites for that. Use an Alias.
Alias "/content/" "/home/xxx/content/" or something like that |
using an alias is a nice idea
|
not that smart..sorry
|
Yep, Alias would do what you want. The problem is that Alias directive does not work in .htaccess, you'll have to edit your <VirtualHost> entry in apache config.
|
| All times are GMT -7. The time now is 05:47 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123