vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB3 Programming Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=15)
-   -   [SOLVED] .htaccess Quick Help (https://vborg.vbsupport.ru/showthread.php?t=154817)

Pc 1203 08-10-2007 03:06 AM

[SOLVED] .htaccess Quick Help
 
Hi All,
I'm wondering, how would I rewrite this:

image.php?u=#
to
sig_#.png

Thanks!
- Pc1203

nico_swd 08-10-2007 11:09 AM

Code:

RewriteEngine On
RewriteRule ^sig_(\d{1,11})\.png$ image.php?u=$1


Pc 1203 08-10-2007 01:33 PM

Well, when I type "http://mydomain.tld/sigs/sig_9.png" I get a 404 error. I placed:

Code:

RewriteEngine On
RewriteRule ^sig_(\d{1,11})\.png$ image.php?u=$1

into my .htaccess file in the same directory. And I also checked, my host does allow .htaccess files.

- Pc1203

nico_swd 08-10-2007 05:11 PM

I just tested it on my host and it works. I placed the htaccess file in the same directory as the image.php file.

Btw, I guess that # is only gonna be a numeric value?

Maybe try:

http://mydomain.tld/sig_9.png

?? Not sure where your image.php file is located.

Pc 1203 08-10-2007 06:03 PM

Ok, here's where it is:

mydomain.com/dev/profilesys/image.php
I'm calling it from:
mydomain.com/dev/profilesys/sig_9.png

Here is what I want:
mydomain.com/dev/profilesys/sig_9.png
to point to:
mydomain.com/dev/profilesys/image.php?u=9

- Pc1203

__________________________________________________ _______________
EDIT: Here is the "working" code:

Code:

RewriteEngine on
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^sig_(.+)\.png/?$ image.php?u=$1



All times are GMT. The time now is 08:48 AM.

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.01439 seconds
  • Memory Usage 1,717KB
  • 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
  • (3)bbcode_code_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (5)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