I basically want to debug a cgi programm with gdb by emulating the environment variables and stdin stream.
How do I set the variables and stdin?
I am using lampp and gdb.
Thanks!
I am thinking about setting the
php.ini, my.cnf and httpd.conf default charsets=UTF-8
The website is in swedish lang only.
I have some folders with special chars in them, also some files.
Is there any harm by doing this?
Is it cross-browser safe?
Thanks
I am unable to login into magento admin.
In magento, (in newest release..)
it needs proper domain to login ...but how it is
possible in a local machine...
I found some solution ...in magento forum here...
http://www.magentocommerce.com/boards/viewthread/4337/P15/
They asked to change localhost to h t t p ://127.0.0.1
but when tried it redirects to localhost...?!
Kindly suggest.
I'm using Drupal 6. Typically, when the user requests a URL for which Drupal has no response, it uses index.php as the error document. However, I'd like to suspend this behavior for a specific URL. How can I do this?
RewriteCond %{REQUEST_FILENAME} !=fail
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_URI} !=/favicon.ico
RewriteRule ^(.*)$ index.php?q=$1 [L,QSA]
Where "fail" is the path I want to block. So www.example.com/fail should result in a 404.
Incidentally, what does [L, QSA] do? I've looked at documentation without luck.
Ok, I have a site, and it serves all images and mp3s through a php script and can be controlled and limited, but I am now worried about overall bandwidth of my site. For example, what if someone just sends a million requests to one of my pages? Does anyone have any suggestions into server methods used to prevent this? Should I use mod_cband http://www.howtoforge.com/mod_cband_apache2_bandwidth_quota_throttling_p2?
I have a domain, for example, http://example.com. It is already configured to point to
/var/www/
Basically, i want http://example.com to point to
/var/www/4.0/
and http://example.com/foobar/ to point to
/var/www/moo/
How can I do this with the httpd.conf file for Apache2? Thanks
I just upgrade the PHP version in my VPS to 5.3.2
I used FastCGI and worker MPM in php 5.1.2 or 5.2.1 I forgot, it worked fine, and it was so fast, I like it.
After I upgrade the PHP version, it gives me Internal Server Error 500 on all .php pages.
What is wrong? does FCGI support php 5.3.2?
If yes, there should be some differences in setting it up? what should I change to get it back working?
Thank You
Here I am stuck with my htaccess code. I have been trying to figure it out for the last 11 hours why am I getting a redirect loop for the below code.
Options -Indexes +FollowSymLinks
RewriteEngine on
#Check for no www or www
RewriteCond %{HTTP_HOST} ^dummysite.com$ [or]
RewriteCond %{HTTP_HOST} ^www.dummysite.com$ [NC]
RewriteRule . - [E=FIRSTPART:true]
# IE 6
RewriteCond %{HTTP_USER_AGENT} !MSIE\s6
RewriteCond %{ENV:FIRSTPART} true
RewriteRule ^(.*)$ https://www.dummysite.com/$1 [R=302,L]
Why the above code results into a redirect loop?
EDIT: What I actually want is that if the user is from IE6 then he should be redirected to http version with www as prefix no matter if he types www or not in the url. And on the other hand if the user is from any other browsers then he should be redirected to a https version with www as prefix no matter if he types www in the url or not.
I have a rewrite in htaccess which makes this:
domain.com/ad.php?ad_id=bmw_m3_328942948
into this:
domain.com/ads/bmw_m3_328942948
Problem is the links which are relative to the file wont work...
for instance if a link is pointing at '/bin/edit.php' like this originally:
domain.com/bin/edit.php // WORKS
but after the rewrite the link wants to point here instead:
domain.com/ads/bin/edit.php // NOT WORK - NOTE THE /ads/ DOESN'T EXIST IN REALITY
Do you understand my issue?
What is done about this? Do I have to make ALL links using the newer rewritten format?
.htaccess:
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/ad\.php
RewriteRule ^annons/(.*)$ ad.php?ad_id=$1 [NC,L]
Thanks
This is part of my TV guide script:
//Connect to the database
mysql_connect("localhost","root","PASSWORD");
//Select DB
mysql_select_db("mytvguide");
//Select only results for today and future
$result = mysql_query("SELECT programme, channel, episode, airdate, expiration, setreminder FROM mediumonair where airdate >= now()");
The episodes show up, so there are no issues there. However, it's getting the database to find data that's the issue.
If I add a record for a programme that airs today this should show:
Medium showing on TV4 8:30pm "Episode" Set Reminder
Medium showing on TV4 May 18th - 6:25pm "Episode 2" Set Reminder
Medium showing on TV4 May 18th - 10:25pm "Episode 3" Set Reminder
Medium showing on TV4 May 19th - 7:30pm "Episode 3" Set Reminder
Medium showing on TV4 May 20th - 1:25am "Episode 3" Set Reminder
Medium showing on TV4 May 20th - 6:25pm "Episode 4" Set Reminder
but this shows instead:
Medium showing on TV4 May 18th - 6:25pm "Episode 2" Set Reminder
Medium showing on TV4 May 18th - 10:25pm "Episode 3" Set Reminder
Medium showing on TV4 May 19th - 7:30pm "Episode 3" Set Reminder
Medium showing on TV4 May 20th - 1:25am "Episode 3" Set Reminder
Medium showing on TV4 May 20th - 6:25pm "Episode 4" Set Reminder
I almost have the SQL working; just not sure what the right code is here, to avoid the second mistake showing - as the record (which indicates a show currently airing) does not seem to work at present.
Please can anyone help me with this?
Thanks
Hi,
As part of one our system's we enable a user in the backoffice to add a block of 301 redirects should they need to. This is just a textarea which then populates a specific area of a .htaccess file. As much as this may seem insecure it has only previously used internally by people who know what they are doing but for various reasons they cannot access the specific file. We need now to allow more access to this function, not for the general public, but for people that probably have far less knowledge of regexp etc and syntax in htaccess files. Obviously the major concern here is the user enters some bad syntax and makes their entire site, including the backoffice where they could fix the issue, totally inaccessible without manual intervention. What approaches can i take to make sure that they do not break their site? A htaccess syntax check? copy the file elsewhere and check it doesnt generate a 500 error (with cURL or similar)?. Would welcome any ideas.
Thanks.
I have a MySQL data table, in which I have more than 2 columns. First column has a unique value clinical trial value whereas second column has disease information. There are, in most of the cases, more than 2 disease names in one cell for a single id. I want to spilt those rows which cell contains two or more than two diseases. There is a pattern for searching also, i.e. small character is immediately followed by capital character., e.g. MalariaDengueTuberculosis like this. Suppose for these three diseases there is unique id, it should show like the following:
NCT-ID disease
4534343654 Maleria
4534343654 Dengue
4534343654 Tubercoulsosis
I have site with these files and foldes:
/index.php ( that include php files contained in folder1 and folder2 )
/config.php
/folder1/
/folder2/
I want this:
when a user point to any folder ( folder1, folder2 or any other folder ) then he is redirected to index.php
How could I do that ?
I moved my images directory to a different folder, and now I want to redirect all images requests from that folder to the new one.
I do not have access to the main configuraion file, so I'm doing this in a .htaccess.
I tried this, and it works:
RewriteCond %{REQUEST_URI} old_dir/.+.(jpg|png|gif)$
RewriteRule old_dir/(.+[^/]+..+)$ $1 [L,PT]
But since they have permanently moved, I want to do a proper redirect, so I added the [R] flag, like this:
%{REQUEST_URI} old_dir/.+.(jpg|png|gif)$
RewriteRule old_dir/(.+[^/]+..+)$ $1 [L,PT,R]
But the server gets confused, and returns a 400, so I looked at the log file, and this is what happens:
strip per-dir prefix: C:/wamp/www/natrazyle/old_dir/images/banner.jpg - old_dir/images/banner.jpg
applying pattern 'old_dir/(.+[^/]+..+)$' to uri 'old_dir/images/banner.jpg'
rewrite 'old_dir/images/banner.jpg' - 'images/banner.jpg'
add per-dir prefix: images/banner.jpg - C:/wamp/www/natrazyle/images/banner.jpg
explicitly forcing redirect with http://localhost/C:/wamp/www/natrazyle/images/banner.jpg
As you can see, the full local path gets added after localhost
I know I'm doing something wrong, I just can't figure it out myself.
Any help would be greatly appreciated...
Is it possible to use mod_negotiation to serve up a webp image if the browser supports it, and a jpg otherwise?
For instance, if I link to an image with the path /images/test, it serves the image found at /images/test.webp if the UA knows about webp, or jpg otherwise?
I've tried poking around, but it seems that the Accept headers in Chrome at least look like Accept:*/*, rather than specifying the image type.
If this isn't the way to do it, has anyone got any other suggestions?
I cant seem to send an email using PHP's mail(). I have also tried PHPMailer and Swiftmail with no success. However, the following command on the server delivers mail successfully.
cat test.txt | mail -s "test mail" [email protected]
Is there a way to trace where the problem is coming from? mail() just seems to return true or false.
I am playing with mod_rewrite now, and have successfully enabled it.
However, I need to put a htaccess file inside var/www/ in order to achieve what I want, which is to rename Urls simply...
When I place it my website becomes very strange and nothing basically works...
Is there any code I need to put into the htaccess file in order for things to act normally?
Here is the htaccess file I have so far:
Options +FollowSymLinks
Options +Indexes
RewriteEngine On
RewriteCond %{REQUEST_URI} !^/ad\.php
RewriteRule ^(.*)$ ad.php?ad_id=$1 [L]
My DocumentRoot is also set to var/www/ and my entire website root is there... (index.html etc etc)...
What am I missing about the htaccess?
If you need more input let me know...
The deal is that I have a ZF site for which root directory is /public. How should I go about redirecting to a subdirectory if I want to do next?
I want to have another subdirectory under /public/ that would not be linked to a main website in any way except it using save ZF. Lets say I have this: /public/newsite/ which will include a complete modular ZF (just I have it for the main site). That is the root directory for the NEWSITE would be /public/newsite/public. So my question how do I modify my .htaccess rules so it would redirect any requests from /public/newsite/ to /public/newsite/public/?
Thank you in advance.
I am not able to get through with this code...I need to capture the request but with this code I am able to redirect but it cannot find the particular search page.
RewriteCond %{THE_REQUEST} ^[A-Z]+\ /searcha\.php\?name=(www\.)?([^/\ ]+)[^\ ]*\ HTTP/
RewriteRule ^.*$ http://www.mydomain.com/%2? [R=301,L]
can any one tell me what is I am missing??
We did some maintenance today, and moved our web forums from /forums into the root folder of the domain.
We put in a redirect 301 in a .htaccess file:
Redirect 301 /forums/ http://www.ourforums.com/
However, we used to have some links that contained duplicate /forums folders. I.e. www.ourforums.com/forums/forums/forum.1
Obviously the redirect from above now leads to /forum.1, which odes not exist. I would like the old link to actually point to www.ourforums.com/boards/forum.1. I attempted to use something like:
RewriteRule ^/forums/forums http://www.ourforums.com/boards/ [NC,R=301,L]
Regardless of what I tried though, the Redirect seems to supersede any RewriteRules I put in the same file, regardless of whether I place them before the Redirect.
Is there any way I can somehow ensure the RewriteRule is handled before the Redirect?
We've got our ETags and expiry headers setup properly and when browsing around the site without posting it is really very snappy. However, after any POST (which is almost invariably followed with a 302) you can see the browser re-request all the images. Is there something that could be causing this? Is there a setting that handles this?
Hello guys,
I have mod_cache used in conjunction with mod_cband.
But when we enable mod_cache mod_cband are overridden.
Any idea in order to define the order of execution (I suppose first mod_cache and after mod_cband)?
Thanks
I want example.com/23-45 be transformed to example.com?id=23-45
Could you please post the code I should add to .htaccess file to make this work
(Is this everything I should do to make this work - add a piece of code to .htaccess file ???)
Thanks a lot!
This question already has an answer here:
Reference: mod_rewrite, URL rewriting and “pretty links” explained
2 answers
I have url like this:
www.site.com/index.php?/genero/aventura/av/
But I would like this to be my new url:
site.com/genero/aventura/av/
I used the following code:
<IfModule mod_rewrite.c>RewriteEngine On
RewriteCond %{HTTP_HOST} !^www.site.com/$ [NC]
RewriteRule ^index.php\?/(.*)$ site.com/$1 [R=301,L]
</IfModule>
but only returns me: site.com/index.php?/genero/aventura/av/
This is my latest & full version:
RewriteEngine on
#RewriteCond $1 !^(index\.php|ver_capitulo\.html|google3436eb8eea8b8d6e\.html|BingSiteAuth\.xml |portadas|public|mp3|css|favicon\.ico|js|plantilla|i|swf|plugins|player\.swf|robots\.txt)
RewriteCond $1 !^(index\.php|public|css|js|i|feed|portadas|robots\.txt|BingSiteAuth\.xml|plugins|i|mp3|favicon\.ico|pluginslist\.xml|google3436eb8eea8b8d6e\.html)
RewriteRule ^(.*)$ /index.php?/$1 [L]
#DirectoryIndex index.php
#RewriteCond %{THE_REQUEST} http://www.page.com/index\.php [NC]
#RewriteRule ^(.*?)index\.php$ http://page.com/$1 [L,R=301,NC,NE]
#DirectoryIndex index.php
#RewriteEngine On
Thanks for reading.