Problem with url_rewrite

Get help with installation and running phpwcms here. Please do not post bug reports or feature requests here.
Post Reply
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Problem with url_rewrite

Post by Moan »

Hi there,

I got a problem with the url_rewrite.

I put the 1 behind the "$phpwcms["rewrite_url"] " and took out the underscore in front of the ".htaccess". The links now look like: "kontakt.phtml" but when I klick on it I get the message
Not Found
The requested URL /kontakt.phtml was not found on this server.
What can I do against that? I didn´t modify the .htacces at all. Just for making sure it´s the right one I will post it here
php_flag magic_quotes_gpc Off
php_flag register_globals Off
<IfModule mod_rewrite.c>
DirectoryIndex index.php
RewriteEngine On
RewriteBase /mybase/ #only needed if you're in a subdir
##This will rewrite 0.0.0.0.0.html => index.php?id=0.0.0.0.0
RewriteRule ^([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)\.([0-9]*)\.html$ index.php?id=$1.$2.$3.$4.$5.$6
##This will rewrite mypage.html => index.php?mypage
RewriteRule ^([a-zA-Z0-9_]*)\.html$ index.php?$1
</IfModule>
I activated Apache´s LoadModule rewrite_module modules/mod_rewrite.so

What did I not do yet? Is there something missing?

Thanks in advance

Dani
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post by flip-flop »

Hi,
here are the _.htaccess of 1.2.5 CVS

Code: Select all

# These settings are recommend
# Maybe you might have problems
# with other scripts that needs
# register_globals ON
php_flag magic_quotes_gpc Off
php_flag register_globals Off


# Rewrite functionality for phpwcms
# optimized by Jan212
# 18-04-2004

# Check that you have set Options FollowSymLinks
# and right Allow
RewriteEngine On

# maybe you need this
#DirectoryIndex index.html index.php 


# Default ReWrite settings for phpwcms
# ===============================================
# This will rewrite 0.0.0.0.0.0.phtml => index.php?id=0.0.0.0.0.0
RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ index.php?id=$1,$2,$3,$4,$5,$6

# This will rewrite mypage.phtml => index.php?mypage
RewriteRule ^(.+)\.phtml$ index.php?$1


# If phpwcms is installed in a subdirectory,
# sample: "mysubdir" then use this (remove #)
# if above lines doesn't work for you
# ===============================================
#RewriteBase /mysubdir
#RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ /mysubdir/index.php?id=$1,$2,$3,$4,$5,$6
#RewriteRule ^(.+)\.phtml$ /mysubdir/index.php?$1 


# If you want to set rewrite logging
# ===============================================
#RewriteLog "/absolute/path/to/the/rewrite.log" 
# 0 = Logging disabled, 9 = highest level of logging, only for debugging 
#RewriteLogLevel 3
If it does´t work, please create a file named php.ini in your phpwcms root-dir and comment out this line in your .htaccess.
php.ini:

Code: Select all

php_flag magic_quotes_gpc Off
php_flag register_globals Off
Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Hi there,

thanks Knut for your help. I did everything you told me and the links are rewritten to *.html but still when I klick on a link i get a "file not found"-message.

It seems that it doesnt solve up the links properly.

Any other idea?

Greetz Dani
User avatar
flip-flop
Moderator
Posts: 8178
Joined: Sat 21. May 2005, 21:25
Location: HAMM (Germany)
Contact:

Post by flip-flop »

Hi,


1. Have you installed phpwcms in a subdirectory?
Please activate tho following lines in your .htaccess: (changes mysubdir to yours)

Code: Select all

# If phpwcms is installed in a subdirectory,
# sample: "mysubdir" then use this (remove #)
# if above lines doesn't work for you
# ===============================================
RewriteBase /mysubdir
RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ /mysubdir/index.php?id=$1,$2,$3,$4,$5,$6
RewriteRule ^(.+)\.phtml$ /mysubdir/index.php?$1
Comment out this lines -->:

Code: Select all

# --> RewriteRule ^([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)\.phtml$ index.php?id=$1,$2,$3,$4,$5,$6

# This will rewrite mypage.phtml => index.php?mypage
# --> RewriteRule ^(.+)\.phtml$ index.php?$1
2. Erase your browsercache
3. Erase the cache of phpwcms
4. Test and it runs?

The extend called .phtml


Knut
>> HowTo | DOCU | FAQ | TEMPLATES/DOCS << ( SITE )
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Great Knut, Thanks for your help...

It´s running on localhost...now I make the big test online...

//edit: And online the thing doesnt´t work...:cry:

Has anybody else here got his page at 123webhost/webcommedia ?
It seems that it is a little different there (Shared Hosting)....

So please, if anybody already had the same problem, could you please gimme the answer

Greetz

Dani 8)
Pappnase

Post by Pappnase »

hello

did you look if mod_rewirte is enabled at your webspace!?
Moan
Posts: 28
Joined: Wed 27. Jul 2005, 01:04

Post by Moan »

Yes, it definitely is....*getting slightly mad now 8) *
Loaded Modules [...] , mod_rewrite,
If I have a sharedHosting, do I have to write the complete the path as the subdirectory? The phpwcms.php and index.php are situated beneath the /html-Directory.

Do I have to put something like this :/srv/www/htdocs/web57/html/ as the subdirectory?
User avatar
Marceau
Posts: 201
Joined: Sun 23. Apr 2006, 01:52
Location: Leipzig, Germany
Contact:

Post by Marceau »

hello @ all
i have the same alert like moan and so i tried to find the .htaccess but there was no match, id didnt found it? Whre ca i find that file ?

p.s. i have shared hosting too. If its possible to give me the answer in german it would be really great :)

Regards, Marceau
There are 10 types of people in the world: Those who understand binary and those who don't
SNap
Posts: 314
Joined: Wed 5. May 2004, 10:45
Location: Passau, Bavaria, Germany
Contact:

Post by SNap »

if you are on a confixx-server you need a httpd-special entry from your Admin....

Code: Select all

Options +FollowSymLinks +SymLinksIfOwnerMatch
'welcome to the real world!' datensysteme-lenk
Post Reply