Linux - ServerThis forum is for the discussion of Linux Software used in a server related context.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I think PlymWS rule gets into an infinite rewrite loop (/script.php/script.php/script.php/.../result.xml).
bathory's result should work well for .xml files in the root, but it will not redirect say /something/result.xml to /script.php/something/result.xml. I think it is equivalent to
Code:
Options +FollowSymlinks
RewriteEngine on
RewriteRule ^/+([^/]*\.xml)$ /script.php/$1 [L]
If you need the redirection for .xml files in subdirectories too, try
Thanks to both for your replies. I have tried both and they both 404 on sub directories. Looking at the web console in FF it seems that a subdirectory xml isn't rewritten.
The requested URL /sub1/result.xml was not found on this server.
Thanks to both for your replies. I have tried both and they both 404 on sub directories. Looking at the web console in FF it seems that a subdirectory xml isn't rewritten.
The requested URL /sub1/result.xml was not found on this server.
I got a multi-site/multi-vhost webserver with apache2 + drupal7 and squeeze. Everything is running fine but I want to redirect all root domain requests to the www vhost from the apache config files instead of .htaccess. That is where I got stuck as all the examples I found were doing it in the .htaccess and they use RewriteCond.
Since the requested URL is already known in the corresponding vhost's section further search would be unnecessary therefore I've commented out the condition. It doesn't work either way.
Do I need to trigger a true condition before going to the RewriteRule or is that true by default? If so how to do that?
Do I need to trigger a true condition before going to the RewriteRule or is that true by default? If so how to do that?
You need the condition, because otherwise you'll get a loop, as apache will run the RewriteRule regardless of the HTTP_HOST variable (i.e. for both example.com and www.example.com)
BTW, next time please don't hijack others threads. Start you own thread, so it gets the attention it deserves
You need the condition, because otherwise you'll get a loop, as apache will run the RewriteRule regardless of the HTTP_HOST variable (i.e. for both example.com and www.example.com)
No, apache doesn't run the RewriteRule at all and there is no loop. Also the www.example.com has a separate VirtualHost section that points to the appropriate html dir. So if the RewriteRule would work apache would go to the corresponding VirtualHost section leaving this.
The rewrite module is installed and works perfectly with all the drupal sites, they all use clean URLs.
Quote:
Originally Posted by bathory
BTW, next time please don't hijack others threads. Start you own thread, so it gets the attention it deserves
That was the original scenario but when I attempted to submit my topic the CMS suggested me to search for existing threads before starting a new one. It also gave me related search results by default so I picked this topic from the list.
That was the original scenario but when I attempted to submit my topic the CMS suggested me to search for existing threads before starting a new one. It also gave me related search results by default so I picked this topic from the list.
I guess it suggested you to look for answers in similar threads, but you could still start your own.
So please do so, posting distro, apache config files (especially the vhosts), so we can try to find what's wrong.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.