vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   .htaccess problems (https://vborg.vbsupport.ru/showthread.php?t=137210)

sabret00the 01-22-2007 11:49 AM

.htaccess problems
 
can anyone tell me why this isn't working? it's stored within the confessions directory.

HTML Code:

RewriteEngine on
RewriteRule ^(.*)/$ index.php?confessionid=$1
RewriteRule ^(.*)/keyword/$ index.php?view=random&keyword=$1
RewriteRule ^(.*)/view=(.*)$ index.php?view=$1

with that i should be able to have these three working
www.site.com/confessions/580
www.site.com/confessions/view=random
www.site.com/confessions/view=votes
www.site.com/confessions/keyword/acid

and yet none of them seem to be working. if i add a backslash after each one i don't get a 404 but for some reason the php isn't picking up the $_GET's or something.

Adrian Schneider 01-22-2007 01:57 PM

I know my webserver has problems picking up .htaccess files that aren't in the webroot (allowoverride setting or something)

Slighty off topic: do NOT use (.*) to match URLs! It is greedy, so it willl often match more than you wanted, and is lazy because it allows anything to go through when it shouldn't.

If it is an ID, use ([0-9]+)
If it is a title (clean), use ([-a-z0-9]+) (adjust according to needs)

Code:

RewriteEngine on
RewriteRule ^([0-9]+)/$ index.php?confessionid=$1
RewriteRule ^([-a-z0-9]+)/keyword/$ index.php?view=random&keyword=$1
RewriteRule ^(.*)/view=(.*)$ index.php?view=$1 #dont understand the logic here


sabret00the 01-24-2007 12:54 PM

on the last one i wanted to be able able to have www.site.com/confessions/view=random/ and www.site.com/confessions/view=votes/ both work. thanks for your assistance thus far, i appreciate it.

i know that it's picking up the .htaccess file though, it's just not behaving as expected for some reason.


All times are GMT. The time now is 10:51 PM.

Powered by vBulletin® Version 3.8.12 by vBS
Copyright ©2000 - 2025, vBulletin Solutions Inc.

X vBulletin 3.8.12 by vBS Debug Information
  • Page Generation 0.01586 seconds
  • Memory Usage 1,714KB
  • Queries Executed 10 (?)
More Information
Template Usage:
  • (1)ad_footer_end
  • (1)ad_footer_start
  • (1)ad_header_end
  • (1)ad_header_logo
  • (1)ad_navbar_below
  • (1)bbcode_code_printable
  • (1)bbcode_html_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (3)printthreadbit
  • (1)spacer_close
  • (1)spacer_open 

Phrase Groups Available:
  • global
  • postbit
  • showthread
Included Files:
  • ./printthread.php
  • ./global.php
  • ./includes/init.php
  • ./includes/class_core.php
  • ./includes/config.php
  • ./includes/functions.php
  • ./includes/class_hook.php
  • ./includes/modsystem_functions.php
  • ./includes/class_bbcode_alt.php
  • ./includes/class_bbcode.php
  • ./includes/functions_bigthree.php 

Hooks Called:
  • init_startup
  • init_startup_session_setup_start
  • init_startup_session_setup_complete
  • cache_permissions
  • fetch_threadinfo_query
  • fetch_threadinfo
  • fetch_foruminfo
  • style_fetch
  • cache_templates
  • global_start
  • parse_templates
  • global_setup_complete
  • printthread_start
  • bbcode_fetch_tags
  • bbcode_create
  • bbcode_parse_start
  • bbcode_parse_complete_precache
  • bbcode_parse_complete
  • printthread_post
  • printthread_complete