.htaccess

Use GitHub to post feature requests for phpwcms.
Locked
Paal
Posts: 204
Joined: Wed 6. Oct 2004, 19:54
Location: Budapest, Hungary
Contact:

.htaccess

Post by Paal »

Change .htaccess file from

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
to

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

# if rewrite modul set OFF (or not loaded) in Apache config, pages come back "ERROR 500"
<IfModule mod_rewrite.c>

  # 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

</IfModule>
Pappnase

Post by Pappnase »

hello

and for what should this be!? what does this solve!?
User avatar
juergen
Moderator
Posts: 4556
Joined: Mon 10. Jan 2005, 18:10
Location: Weinheim
Contact:

Post by juergen »

Hi !

As far as I can see this is a try to check if the apache rewrite engine is set on, or better: Produces PHTML only if the mod is set on. If not set on, htacess... produces only error 500(4XX)

I played around with this a while likely going crazy with all the different errors produced by my own dedicatet indian friend.

mod_switch_ language:

Soweit ich das verstehe, hat er eine Einschränkung in die .htaccess eingebaut, die erst mal nachsieht ob das Modul eingeschaltet ist.

re_switch:

Topics from this issue in german language: http://modrewrite.de

Be warned when using this ! Google should learn reading :roll: Thats better than reading Apache books !

Jürgen
ShyGuy
Posts: 158
Joined: Sat 11. Nov 2006, 15:27
Location: DE-Hannover
Contact:

You are my hero...

Post by ShyGuy »

I tried to install the cms since a couple of days but I always failed. The server returned an ERROR 500 and I tried so many things which doesn't solved the problem. After applying your changes, the server gave me asscess to the setup.

Thanks a lot - you can not imagine how happy I am !


Regds, Stefan


---
Paal
Posts: 204
Joined: Wed 6. Oct 2004, 19:54
Location: Budapest, Hungary
Contact:

Re: You are my hero...

Post by Paal »

ShyGuy wrote:I tried to install the cms since a couple of days but I always failed. The server returned an ERROR 500 and I tried so many things which doesn't solved the problem. After applying your changes, the server gave me asscess to the setup.

Thanks a lot - you can not imagine how happy I am !


Regds, Stefan


---
Great! :)

Paul
User avatar
lady_witchcraft
Posts: 94
Joined: Sun 14. Nov 2004, 19:19
Location: Austria
Contact:

Post by lady_witchcraft »

@Paaal:

THX A LOT for the modification everything works fine with rewrite!!! well done!!!
... it's not bad luck, it's a bug ...
Locked