Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.
What is needed for modules to run?

 
Post new topic   Reply to topic    Smarty Forum Index -> Bugs
View previous topic :: View next topic  
Author Message
CustomNet
Smarty n00b


Joined: 27 Apr 2013
Posts: 2

PostPosted: Sat Apr 27, 2013 10:42 pm    Post subject: What is needed for modules to run? Reply with quote

Hey guys,

I've just got a new script using Smarty and I did setup a nginx VPS however the owner of the script said it only works on apache (didn't question it).

I re installed the server but this time with Apache2 and the main page loads and DB connection is fine however when it tries to access a module it doesn't work correctly.

For example this is a module for registrations (/module/register/) and the link to register is http://mysite.com/register/ which is meant to use the files in http://mysite.com/module/register/ but to stay with just /register URL.

However I'm just receiving a 404 saying http://mysite.com/register/ doesn't exist (which is doesn't) but it's not using the correct directory.

On his demo sites this works fine however on mine it does not, he said this must be an issue with my server. So what do I need to make sure I have on my server that allows smarty / modules / rewrites to run?
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7299
Location: Lincoln Nebraska, USA

PostPosted: Sun Apr 28, 2013 12:36 am    Post subject: Reply with quote

you probably need to setup an .htaccess with the rewrite rules for your new script. check with the support for that script how to setup the server.
Back to top
View user's profile Send private message Visit poster's website
CustomNet
Smarty n00b


Joined: 27 Apr 2013
Posts: 2

PostPosted: Sun Apr 28, 2013 9:07 am    Post subject: Reply with quote

mohrt wrote:
you probably need to setup an .htaccess with the rewrite rules for your new script. check with the support for that script how to setup the server.


There already is a .htaccess and he said it should work fine on apache.

.htaccess:
Code:

RewriteEngine On
RewriteRule ^activation\/([0-9]+)\/([a-zA-Z0-9]{32})\/?$ index.php?mode=register&function=view&modname=$2&id=$1 [L]
RewriteRule ^index\.html$ index.php [L]

RewriteRule ^download\/([0-9]+)\/(.*)$ index.php?mode=download&global_id=$1&modname=$2 [L]
RewriteRule ^ref\/([0-9]+)\/?$ index.php?mode=register&ref=$1 [L]

# page
RewriteRule ^([a-zA-Z0-9_\-]+)\.html$ index.php?mode=page&modname=$1 [L]

RewriteRule ^([a-zA-Z0-9\-_]+)\/([0-9]+)\/([a-zA-Z0-9_\-]+)\/(page|strona)\/([0-9]+)\/?$ index.php?mode=$1&function=view&id=$2&modname=$3&s=$5 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/([0-9]+)\/([a-zA-Z0-9_\-]+)\/?$ index.php?mode=$1&function=view&id=$2&modname=$3 [L]

# mode
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\-([0-9]+)\/(page|strona)\/([0-9]+)\/?$ index.php?mode=$1&id=$3&s=$5&modname=$2 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\-([0-9]+)\/?$ index.php?mode=$1&id=$3&modname=$2 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/(page|strona)\/([0-9]+)\/?$ index.php?mode=$1&s=$3 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/?$ index.php?mode=$1 [L]

# mode + function
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\-([0-9]+)\/(page|strona)\/([0-9]+)\/?$ index.php?mode=$1&function=$2&id=$4&s=$6&modname=$3 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\-([0-9]+)\/?$ index.php?mode=$1&function=$2&id=$4&modname=$3 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/(page|strona)\/([0-9]+)\/?$ index.php?mode=$1&function=$2&s=$4 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/?$ index.php?mode=$1&function=$2 [L]

# mode + function + method
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\-([0-9]+)\/(page|strona)\/([0-9]+)\/?$ index.php?mode=$1&function=$2&method=$3&id=$5&s=$7&modname=$4 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\-([0-9]+)\/?$ index.php?mode=$1&function=$2&method=$3&id=$5&modname=$4 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/(page|strona)\/([0-9]+)\/?$ index.php?mode=$1&function=$2&method=$3&s=$5 [L]
RewriteRule ^([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/([a-zA-Z0-9\-_]+)\/?$ index.php?mode=$1&function=$2&method=$3 [L]
Back to top
View user's profile Send private message
mohrt
Administrator


Joined: 16 Apr 2003
Posts: 7299
Location: Lincoln Nebraska, USA

PostPosted: Sun Apr 28, 2013 6:43 pm    Post subject: Reply with quote

Do the rewrites work? if not you might check that your apache allows .htaccess files.
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> Bugs All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP