Jump to content

blacksnday

Members
  • Posts

    12
  • Joined

  • Last visited

    Never

Profile Information

  • Gender
    Not Telling

blacksnday's Achievements

Newbie

Newbie (1/5)

0

Reputation

  1. I want to use "in=", "title=", and "page=" simply for ease. Eventually I plan to write a full URL Rewrite class that would address several issues but for now I am just doing it all through .htaccess. Your php example is great and also brought me to some other ideas for uses of it. This problem is fully solved now, and I thank you for spending the time teaching me a few things!
  2. Here is all the combinations and url styling I am looking to achieve/allow: (this is a little different then earlier posted, because I am attempting a clean url scheme) /in=16/title=World-of-Warcraft-Rocks /in=16/title=World-of-Warcraft-Rocks.html /in=16/title=World-of-Warcraft-Rocks.html/ /in=16/title=World-of-Warcraft-Rocks/page=1.html /in=16/title=World-of-Warcraft-Rocks/1.html
  3. [quote author=effigy link=topic=120531.msg495590#msg495590 date=1167770907] What about your original regex with mine applied? [code]RewriteRule info/(.*)/(.*).html/(?:(.*)\.html)? index.php?id=$1&title=$2&cpage=$3[/code] [/quote] The problem with that is with[b].html/[/b] as it is always required otherwise it fails. How do I make the [b].html[/b] and the [b]/[/b] seperate and each optional? That would solve my problems.
  4. I just realized, that doing it this way: [code]RewriteRule in-(.*)-(?:(.*))-(?:(.*)\.html)? index.php?id=$1&title=$2&cpage=$3[/code] Is causing the server global $_GET to jumble and mix id,title,cpage within eachother. when changing it to [code]RewriteRule in=(.*)/title=(?:(.*))/cpage=(?:(.*)\.html)? index.php?id=$1&title=$2&cpage=$3[/code] of course it messes it up and wont work as hoped for, however the server $_GET is just fine now. Hmmm, more work is needed by me on this.
  5. [quote author=effigy link=topic=120531.msg495546#msg495546 date=1167766695] Thanks. I thought I was confused for a moment, but it looks like you're all set--correct? [/quote] Yes, all set now. Thanks for the advice!
  6. Sure! Based on calling: [b]index.php?id=$1&title=$2&cpage=$3[/b] URL on selected article without comment pagination: [b]http://localhost/links/in-16-World-of-Warcraft-Rocks.html[/b] (the .html on this link is now optional and can be omitted when the below pagination link is called, thanks to the advice and changes in the .htaccess RewriteRule) URL on selected article with comment pagination: [b]http://localhost/links/in-16-World-of-Warcraft-Rocks/page-1.html[/b] The [b]/page-1.html[/b] can also use [b]-page-1.html[/b].
  7. [quote author=effigy link=topic=120531.msg495439#msg495439 date=1167759806] Try changing[tt] (.*).html [/tt]to[tt] (?:(.*)\.html)?[/tt]. The period is a metacharacter, so it must be backslashed to be taken as a literal.[tt] (?: ) [/tt]is used to group without capturing, and the[tt] ? [/tt]following it makes it optional. [/quote] Based on your suggestions I changed it to the below, which works now exactly as needed. In my situation, I needed this to work to allow for article selection and viewing, as well as SEO friendly comment pagination if comments are available and the max view is exceeded. How does this look now? [code]RewriteRule in-(.*)-(?:(.*))-(?:(.*)\.html)? index.php?id=$1&title=$2&cpage=$3[/code] This now allows an optional .html extension(when viewing article without comment pagination) and one required .html(default for comment pagination extension), as well as optional title/cpage values.
  8. This is being used inside Apache .htaccess but figured I would post here since it is regex. How would the following be changed, in order to allow a conditional check? [code]RewriteRule info/(.*)/(.*).html/(.*).html index.php?id=$1&title=$2&cpage=$3[/code] this would make a url such as: [code]links/info/16/World-of-Warcraft-Rocks.html/0.html[/code] What I want to be conditional would be the last two parts... [code]title=$2&cpage=$3[/code] If there is no [b]cpage[/b] in the url, it would fail as written, but I want it to succeed if or if not [b]cpage[/b] is included
  9. [quote author=shoz link=topic=107233.msg429967#msg429967 date=1157644079]Blocking based on a rule saying for example that if an ip accesses more than x number of pages within x time block for x minutes is ok, but you'll probably want to make exceptions for google yahoo etc (By IP/User-Agent or using some other method). Depending on why you're doing it, it may not be worth the trouble.[/quote] Currently I dont block/ban based on ip accesses more than x number of pages within x time block for x minutes (even though I got some alpha-type code coming for that soon) At this time I probably will block the UA with User-Agent and since I track all bans/who was blocked by what ban/what UA they had, etc... I will be able to better determine at a later date if 'Good' people are being wrongly banned. Thanks for the help!
  10. [quote author=shoz link=topic=107233.msg429950#msg429950 date=1157641942] It's probably an error in the bot that's being used to access the page. The "User-Agent" string should be part of the Headers "field name" and not a part of the value. The application is probably sending the header in the way shown below. [code] User-Agent: User-Agent: ... [/code] [/quote] So basically I would be safe to assume it is a Bot when it appears this way? As the logs show it sure acts like a bot when loading 10+pages in less then 1second.
  11. Yea, FF also offers a plugin to change the UA. My IP/UA blocker I use with extreme caution, hence the question. The way I block UA's are based on Keywords such as: WebWhacker, WWWCopy, BackStreet Browser etc... And alot of programs use same UA and cannot be changed such as stuff like: Java and WebCapture (Adobe Acrobat web grabbing for preserving as a PDF) etc.. I dont actually ban by Full UA... just keywords that shouldnt be in the UA which can help show its Bad.. and which still allows other stuff like RssFwd to work with no probs :P which brings to try and figure out if User-Agent is good or bad because why would a UA string tell you it's a User-Agent when it is already known to be? hrmm..
  12. Normally when viewing User Agents for Browsers, it would look similar to: [b]Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)[/b] My question is, if it shows by first saying [b]User-Agent:[/b] such as: [b]User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1)[/b] would you believe it was real or fake, or do certain things really put [b]User-Agent:[/b] within the UA id? My reason for this question is to either block or allow it. Within the past few days been recieving hits with that type of UA and the few different IPs showing that UA have been basiclly loading up to 10 pages per second which makes me think it is not a valid UA.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.