
cags
Staff Alumni-
Posts
3,217 -
Joined
-
Last visited
Everything posted by cags
-
The error is probably being caused by your <base> tag. $_SERVER['DOCUMENT_ROOT'] returns a local path on the server. The <base> node is supposed to use a standard URL. Remove the <base> tag (or fix it to be your sites URL root, i.e. http://www.domain.com) and get rid of the chmod stuff and you should be about right. The only other problem you are likely to run into is '404 Page Not Found' for the <link> and <script> tags. The paths used for the href/src are relative, this can often cause problems when working with files that aren't in the root folder. You can fix that by simply adding a forward slash to the start of the path, thus making it relative to root.
-
Very community spirited of you.
-
No he was right first time, that's sarcasm. I'm not putting in more effort to solve your problem than you are. Therefore, "doesn't work", doesn't cut it.
-
With you providing such elaborate details, it's amazing you haven't found a solution.
-
It's part of the game. There are rules as to what physical contact is allowed between players, and if you feel someone's violating these rules, you need to take advantage of this. If that's the case, how come it has only really become prevalent in the last 10 or so years. There was none of this shirt pulling, diving, pretending to be punched in the face shit back in the 'glory days'. If somebody violates the rules it's down to the referee to decide, not some overpaid nancy boy that likes to play act.
-
RewriteRule ^forums/?$ - [L]
-
test/something is technically two folders deep, whereas test.php/(.*) is in the top level folder. There fore the relative second value of test.php?id=$1 is pointing at the wrong folder. Simply placing a forward slash before it should fix that issue. RewriteRule ^test/(.*)$ /testitemnews.php?id=$1 [QSA,L] Assuming of course that testitemnews is in the root folder.
-
That code seems way overkill. It matches the POSIX style of digit, within a character class, I have no idea why it also uses a capture group and alteration to match the comma as it could have been placed within the character class. [[:digit:],]+ further more... [0-9,]+ or even... [\d,]+
-
I didn't watch the game so can't really comment on the aggressive 'negative' football that Holland supposedly played. But I think throughout the tournament as a whole there were too many cards handed out for practically nothing. The pussies need to learn to try and stay on their feet, not just roll over 8 times in agony because somebody caught their toe slightly, only to jump up ready to take the free kick as soon as the ref blows the whistle.
-
htaccess not working with ~username URL. Please HELP!
cags replied to DingDong's topic in Apache HTTP Server
The first part of a RewriteRule matches against the REQUEST_URI, not the full path so the second example is definitely incorrect. As for your first example, this would assume that the .htaccess file is in the /~sitename/ folder. I'm also not clear on why you have the forward slash before the dollar. My best guess at what you're after is... RewriteRule ^testitemnews/(.*)$ /~sitename/test.php?id=$1 [QSA,L] -
I'm really not sure what you want from us, because given the file you attached and the code you claim to be using, neither patterns you have tried will return nothing. The first one would return 'Matthew', the second would return most of the entire file (C.V's last idea was perhaps supposed to include the m modifier).
-
But of course your not going to want to use 'page' for both items of information.
-
Which is obvious why it didn't work as that output doesn't match the input you mentioned. It has a pairing ID in the opening and closing tag. You never once mentioned this, nor listed it in your example where you claimed it didn't work.
-
Probably depends on the distro. You could try... ps aux | grep tomcat. (That could be completely wrong I'm a proper Linux newb, just happened to be looking for the user running Apache the other day).
-
What makes you say that, works as far as I can tell... $input = '[quote="NAME_HERE"] QUOTE_HERE[/quote] Nice quote'; $pattern = '#\[quote[^]]*\].*?\[/quote\]#is'; $output = preg_replace($pattern, '', $input); echo $output;
-
Probably because your input has newline characters between the tags. By default the . does not match newline characters, if you need it to do so then add the s modifier, you may also wish to add the i modifier to make it case-insensitive, so that
-
The most likely reason would seem to be that the REQUEST_URI does not begin with 'account/'. Is the .htaccess file located in the root folder? If it isn't and is instead located in a sub-folder then the URL you are matching against will not be a full URL. What I mean by this is if your .htaccess file is in a folder called account. Then the pattern would simply need to be. Options +FollowSymlinks RewriteEngine on RewriteRule ^(.+)$ /users/account.php?mod=$1 [NC]
-
The 'correct' way of doing this would not be via mod_rewrite. You should be setting up img.mysite.com with it's own named virtualhost via an apache .conf file. Assuming this isn't an option for you it can be done with mod_rewrite, you'd use something like this.... RewriteCond %{HTTP_HOST} ^img.mysite.com RewriteRule ^.*$ http://mysite.com/images/%{REQUEST_URI}
-
As far as I can tell the only things at fault with the OPs original post was the attempting to use str_replace (which doesn't support REGEX patterns) rather than preg_replace. And the fact that with preg_replace the pattern would require delimiters. Assuming the input could contain more than one quote block however you will also need to make the section between the tags lazy (which I've done with the question mark). Also making the first catch all match lazy or changing it is required (I replaced it with 'one or more character(s) not ]). $pattern = '#\[quote[^]]*\].*?\[/quote\]#'; $output = preg_replace($pattern, '', $input);
-
That would indeed seem to be indicated. If that is literally all that's in your .htaccess then mod_rewrite must be enabled, because if it isn't Apache will be treating it like an empty file because it won't go into the 'if block'. Normally internal server errors will cause an error to be written to an error log, but chances are if you are on shared hosting, you won't actually have access to view those logs. The only other thing I can think of is if you perhaps tried adding... Options +FollowSymLinks ... at the top of your .htacess file.
-
If you don't have access to any of the config then there is likely nothing you can do. Have you tried the basic rewrite in an IfModule block? If that works then the answer is almost certainly that mod_rewrite isn't enabled. <IfModule mod_rewrite.c> RewriteEngine On RewriteRule ^.*$ http://www.google.com [R=302] </IfModule>
-
Does a simple rewrite also break your site? RewriteEngine On RewriteRule ^.*$ http://www.google.com [R=302]
-
LOL - that's a good one.
-
The webmaster being the aforementioned PHPFreak. You said the statement to Daniel0, who is a member, just like you and me, albeit with more access rights.