Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
howto enable .htaccess
#1
Question:
I am trying to rewrite the URLs from index.php?page=xxx&id=123 to something more cleaner such as /home/123/ - however I cannot get the .htaccess to load, despite it being enabled in Ubuntu 8.10 with latest apache php etc. and have read that you can do it using Custom HTTP in the EHCP panel, I was wondering if you can provide an example of how to do this with the above scenario?

Answer:

Follow these steps:
1- enable mod_rewrite by: ln -s /etc/apache2/mods-enabled/rewrite.load /etc/apache2/mods-available/rewrite.load
in linux console,
2- replace your apachetemplate file in ehcp dir with following:

<code>

#____________start of {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________
# explanation {aciklama}
# Namevirtualhost *:80
# &lt;VirtualHost *:80&gt;

&lt;VirtualHost *&gt;
ServerName {domainname}
ServerAlias www.{domainname}
UseCanonicalName Off
DocumentRoot {homedir}/httpdocs

# this combined log format is understandable by webalizer... some other formats are not recognised by webalizer.. thats why, specified here explicitly..

LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v:%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog {homedir}/logs/access_log combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir {homedir}
php_admin_value upload_tmp_dir {homedir}/phptmpdir

AccessFileName .htaccess

&lt;Directory {homedir}/httpdocs&gt;
AllowOverride All
&lt;/Directory&gt;


{customhttp}

&lt;/VirtualHost&gt;

&lt;VirtualHost *&gt;
ServerAlias webmail.{domainname}
DocumentRoot /var/www/vhosts/ehcp/webmail

LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v:%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog {homedir}/logs/access_log combined
CustomLog /var/log/apache_common_access_log vhost_combined


php_admin_value open_basedir /var/www/vhosts/ehcp/webmail
php_admin_value upload_tmp_dir /var/www/vhosts/ehcp/webmail/data

&lt;/VirtualHost&gt;


#____________end of {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________




</code>







3- # what we added in previous step is actually (summary here):
<code>
AccessFileName .htaccess

&lt;Directory {homedir}/httpdocs&gt;
AllowOverride All
&lt;/Directory&gt;

</code>

4- on ehcp, options, click on sync domains,
this way, your .htacces will be activated.
To ensure that it is activated for example,
write in it asdfasdfasdfasdfasdf
and navigate to your page,
if you see http error, then .htaccess is activated.
if you see normal webpage, then .htaccess is not enabled...


(These steps will be done/enabled by default in newer versions than 0.29.05)

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply
#2
Here is my apachetemplate is this correct, because it still doesn't work

<code>

#____________start of {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________
# explanation {aciklama}
# Namevirtualhost *:80
# &lt;VirtualHost *:80&gt;

&lt;VirtualHost *&gt;
ServerName {domainname}
ServerAlias www.{domainname}
UseCanonicalName Off
DocumentRoot {homedir}/httpdocs

# this combined log format is understandable by webalizer... some other formats are not recognised by webalizer.. thats why, specified here explicitly..

LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v:%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog {homedir}/logs/access_log combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir {homedir}
php_admin_value upload_tmp_dir {homedir}/phptmpdir

AccessFileName .htaccess

&lt;Directory {homedir}/httpdocs&gt;
AllowOverride All
&lt;/Directory&gt;

{customhttp}

&lt;/VirtualHost&gt;

&lt;VirtualHost *&gt;
ServerAlias webmail.{domainname}
DocumentRoot /var/www/vhosts/ehcp/webmail

LogFormat "%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
LogFormat "%v:%h %l %u %t \"%r\" %&gt;s %b \"%{Referer}i\" \"%{User-Agent}i\"" vhost_combined
CustomLog {homedir}/logs/access_log combined
CustomLog /var/log/apache_common_access_log vhost_combined

php_admin_value open_basedir /var/www/vhosts/ehcp/webmail
php_admin_value upload_tmp_dir /var/www/vhosts/ehcp/webmail/data

&lt;/VirtualHost&gt;

#____________end of {domainname}__paneluser:{panelusername}_reseller:{reseller}_id:{id}____________

# what we added in previous step is actually (summary here):

AccessFileName .htaccess

&lt;Directory {homedir}/httpdocs&gt;
AllowOverride All
&lt;/Directory&gt;
</code>

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply
#3
i am not sure exactly,
Defined here exactly: http://httpd.apache.org/docs/1.3/mod/core.html#accessfilename

I have not verified and i am unsure. This is exactly apache feature and apache config...
is there anybody that made this work ?




Restored from old drupal forum, for user uid:1738 username:jrbrownusa
You may reset your password to access your new account here.
Reply
#4
I was looking at the above comments.
I got here because I am trying to figure
out server side includes files.

I need a break from DNS servers LOL.

I am hosting a site on my server, the site
is www.scrippin.com, with ehcp Version: 0.29.13.

If I got this correct I put all my files that
the public will see in the directory httpdocs.

Now I want to create a directory and name it includes.
I want to set this directory and any files in it so that
no one can see them, unless they are logged in to the site.

Where is the best place to put the includes directory?

Also, I am figuring that I have to do something with the
.ahtaccess file, if so what?

And I do I have to make a file called something like
root.inc.php that defines the path to the includes directory?
Something like:

<?php
// Define the include path
$includepath = 'root/includes/';
?>

Give your best
Links are always helpful as well

Thanks
jason

Restored from old drupal forum, for user uid:1 username:ehcpdeveloper
You may reset your password to access your new account here.
Reply


Forum Jump:


Users browsing this thread: 2 Guest(s)

Online Shopping App
Online Shopping - E-Commerce Platform
Online Shopping - E-Commerce Platform
Feinunze Schmuck Jewelery Online Shopping