GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Mod_Rewrite Problem - Show How Smart You Are (https://gfy.com/showthread.php?t=636715)

Mutt 07-24-2006 04:32 AM

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

grumpy 07-24-2006 04:35 AM

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 ../../

Mutt 07-24-2006 04:40 AM

thanks - hope it's something simple like that.

extreme 07-24-2006 04:43 AM

Don't use Rewrites for that. Use an Alias.

Alias "/content/" "/home/xxx/content/" or something like that

gooddomains 07-24-2006 04:45 AM

using an alias is a nice idea

DEA - banned for life 07-24-2006 06:23 AM

not that smart..sorry

J.P. 07-24-2006 08:11 AM

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