Forum Moderators: phranque

Message Too Old, No Replies

rewritecond: cannot compile regular .ERROR AFTER CHANGING HOST

         

xdav

5:44 pm on Dec 4, 2008 (gmt 0)

10+ Year Member



Hi.

I have a error after changing hosting. Before this all was ok.

rewritecond: cannot compile regular expression

.htaccess file is:

RewriteEngine On

RewriteCond %{REQUEST_URI} !/index\.php¦/img¦\.css¦\pics¦\downloads¦\img¦\admin¦\tpl¦\forum\.php¦\board\.php¦\board_entry\.php¦\posting\.php¦\login\.php¦\register\.php¦\email\.php¦\admin\.php¦\search\.php¦\forum_entry\.php¦\css\.php¦\jsscript¦\.js¦\.swf¦custom_rb\.js¦downloadprices¦menu\.js¦forum¦\.gif¦\.jpg
RewriteRule ^(.*) /index.php?a=$1

Could anybody help me.
tanks.
Sorry for my bad english.

g1smd

7:50 pm on Dec 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Why the \ on many of the words like \downloads here? Perhaps delete the \ on all like this?

Put ( ) round all the words so it is like !( ) perhaps?

jdMorgan

9:28 pm on Dec 4, 2008 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, that needs some clean-up. I'd suggest something like this, but you will need to check it thoroughly:

# if the request is not for any directories or filenames starting with these strings
RewriteCond %{REQUEST_URI} !^/(admin¦css¦forum¦download(price)?s¦img¦jsscript¦tpl¦pics)
# and not for any of these filetypes
RewriteCond %{REQUEST_URI} !\.(gif¦jpg¦php¦css¦js¦swf)$
# rewrite the request to /index.php
RewriteRule (.*) /index.php?a=$1 [L]

I removed many redundancies that were revealed by organizing the original patterns.

Replace the broken pipe "¦" characters with solid pipe characters before use; Posting on this forum modifies the pipe characters.

Jim

[edited by: jdMorgan at 9:43 pm (utc) on Dec. 4, 2008]

xdav

1:53 am on Dec 5, 2008 (gmt 0)

10+ Year Member



i change .htaccess but after this i'getting 404 error. in server's error log i get this error

[Fri Dec 05 01:47:02 2008] [error] [client 89.146.69.115] PHP Warning: require_once(/home/fresh/data/www/prorab.uz/lib/modules//) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: Unknown error: 0 in /home/fresh/data/www/prorab.uz/index.php on line 125
[Fri Dec 05 01:47:02 2008] [error] [client 89.146.69.115] PHP Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required '/home/fresh/data/www/prorab.uz/lib/modules//' (include_path='.:/usr/local/share/pear') in /home/fresh/data/www/prorab.uz/index.php on line 125
[Fri Dec 05 01:47:03 2008] [error] [client 89.146.69.115] File does not exist: /home/fresh/data/www/prorab.uz/ru

is this error in my vds settings or it in my php code?

(but this site was working ok in first hosting (share hosting) after changing hosting to vds it is'nt working)

thanks.