vb.org Archive

vb.org Archive (https://vborg.vbsupport.ru/index.php)
-   vB4 General Discussions (https://vborg.vbsupport.ru/forumdisplay.php?f=251)
-   -   Mod Rewrite Friendly URLs and Apache 1.3 (https://vborg.vbsupport.ru/showthread.php?t=237203)

FBChris 03-01-2010 04:36 PM

Mod Rewrite Friendly URLs and Apache 1.3
 
Does anyone have the Mod Rewrite Friendly URLs working in combination with Apache 1.3?

I tried using the .htaccess as provided in the /do_not_upload/rewrite/apache2 folder. These rules don't seem to work with Apache 1.3

In my error log the following error shows up...
.htaccess: RewriteRule: cannot compile regular expression '^(?:(.*?)(?:/|$))(.*|$)$'\n

Code:

RewriteEngine on

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
# RewriteBase /forum/

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

# Forum
RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
ReWriteRule ^entries/.* entry.php [QSA]

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

# MVC
RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]


Markos 03-02-2010 10:59 AM

i use this one but it doesn't rewrite it the way it did on 3.8
http://www.vbulletin.com/forum/showt...taccess/page12

FBChris 03-02-2010 02:33 PM

Do you use that one with Apache 1.3?

It gives me a similair problem...
RewriteRule: cannot compile regular expression '^threads/([0-9]+)(?:/?$|(?:-[^/]+))(?:/?$|(?:/page([0-9]+)?))'\n

BSMedia 03-02-2010 08:12 PM

Is there any chance of upgrading your Apache to 2.x?

FBChris 03-08-2010 02:02 PM

Upgrading to Apache 2.x is no really possible at the moment. Maybe in a later stage.

For now I have found some information on http://www.vbsupport.org/forum/showthread.php?t=32958. Its in Russian, with Google translate I found out a little bit more...

Quote:

This error occurs due to that apache 1.3 uses POSIX ERE and apache 2.x uses REGEX. The errors is specifically in the non-capturing clusters "(?: exp)" which is not supported by POSIX ERE or apache 1.3
With some copy and paste from various sources I have come up with a working .htaccess in my Apache 1.3 environment.

Code:

RewriteEngine On

# If you are having problems or are using VirtualDocumentRoot, uncomment this line and set it to your vBulletin directory.
# RewriteBase /forum/

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

RewriteRule ^threads/.* showthread.php [QSA]
RewriteRule ^forums/.* forumdisplay.php [QSA]
RewriteRule ^members/.* member.php [QSA]
RewriteRule ^blogs/.* blog.php [QSA]
ReWriteRule ^entries/.* entry.php [QSA]
RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}

RewriteCond %{REQUEST_FILENAME} -s [OR]
RewriteCond %{REQUEST_FILENAME} -l [OR]
RewriteCond %{REQUEST_FILENAME} -d

RewriteRule ^.*$ - [NC,L]

RewriteRule ^$ $1.php?r=$2 [QSA]


Graex 03-27-2010 03:57 AM

Thanks! For that last .htaccess

I tried it and it works :)

Been searching like crazy for that and was about to give up. :D

vwdforum 04-03-2010 09:09 PM

Works for me thanks!

enigmatic_user 08-24-2010 02:48 PM

Quote:

Originally Posted by FBChris (Post 1999837)
Code:

RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2&%{QUERY_STRING}
RewriteRule ^content/(.*) content.php?r=$1&%{QUERY_STRING}
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1&%{QUERY_STRING}


Why not

Code:

RewriteRule ^list/([^/]*/)([0-9]+) list.php?r=$1$2 [QSA]
RewriteRule ^content/(.*) content.php?r=$1 [QSA]
RewriteRule ^widget/config/([0-9]+) widget.php?r=config/$1 [QSA]

as it is used in the lines before? [QSA] does just that - it appends the existing Query String.

Quote:

Originally Posted by FBChris (Post 1999837)
Code:

RewriteRule ^$ $1.php?r=$2 [QSA]

This line can't work - $1 and $2 are references to bracketed expressions - but there are none...

The original line for Apache 2 is

Code:

RewriteRule ^(?:(.*?)(?:/|$))(.*|$)$ $1.php?r=$2 [QSA]
and can be "translated" to

Code:

RewriteRule ^((.*?)(/|$))(.*|$)$ $2.php?r=$4 [QSA]
which is equivalent.

Cheers,
Jan

Breakpoint 09-22-2011 11:11 PM

Anyone can answer the above question?

fili 06-07-2012 07:43 AM

hello,

Work well for me but i have a question :

http://www.***.com/content/13-test

13 : number of article
Test : title of article

How to delete in .htaccess the number of article ?
or better
is it possible to change the number of article in title of the section ?


All times are GMT. The time now is 10:03 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.01120 seconds
  • Memory Usage 1,737KB
  • 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
  • (7)bbcode_code_printable
  • (3)bbcode_quote_printable
  • (1)footer
  • (1)gobutton
  • (1)header
  • (1)headinclude
  • (6)option
  • (1)post_thanks_navbar_search
  • (1)printthread
  • (10)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