I have about .htaccess and mod_rewrite question.

My system is use ehcp 0.37.3.b on ubuntu 14.04.
I have upload webpage include .htaccess.But it's will show not found.
Follow is .htaccess:

RewriteEngine On
RewriteBase /
RewriteCond %{REQUEST_FILENAME} !-d
RewriteCond %{REQUEST_FILENAME} !-f

RewriteRule ^(.+)-([0-9]+)-([0-9]+)\.phtml$ index.php?action=$1&id=$2&layer=$3
RewriteRule ^t/(.+) index.php?action=tagkey&key=$1
RewriteRule ^key/(.+)/(.+) index.php?action=search&dir=$2&key=$1
RewriteRule ^key/(.+) index.php?action=search&key=$1
RewriteRule ^(.+)-(.+)/(.+)/(.+)/(.+)\.phtml$ index.php?action=service&module=$1&fun=$3&permit=view&id=$2&bid=$5&p=$4 [L]
RewriteRule ^(.+)-(.+)/(.+)/(.+)\.phtml$ index.php?action=service&module=$1&fun=$3&permit=view&id=$2&bid=$4 [L]
RewriteRule ^(.+)-(.+)/(.+)/ index.php?action=$1&id=$2&p=$3
RewriteRule ^(.+)-(.+)/ index.php?action=$1&id=$2
RewriteRule ^article/(.+)/(.+)/ index.php?action=article&id=$1&p=$2
RewriteRule ^article/(.+) index.php?action=article&id=$1
RewriteRule ^guestbook-(.+)\.phtml$ index.php?action=guestbook&p=$1
RewriteRule ^index_(.+)\.phtml$ index.php?action=index&lang=$1
RewriteRule ^calendar-([0-9]+)-([0-9]+)\.phtml$ index.php?action=calendar&year=$1&month=$2
RewriteRule ^(.+)\.phtml$ index.php?action=$1

And I have add some to template like follow:

<Directory {homedir}/httpdocs>
AllowOverride All

Is ehcp 0.37.3.b haven't startup mod_rewrite?How to fix it?

check your apachetemplate file, for appropriate .htaccess apache configurations. consult apache docs for more info.

if you made some custom change to apache congfig of a domain,
use ehcp gui->choose domain->edit apache template

ehcp uses apachetemplate file in ehcp dir, by default,
if a domain's apache template is changed, then, that data is saved database and config in apachetemplate file is not used for that domain.


I have check apache2template and search .htaccess.
I found follow setting.

AccessFileName .htaccess

But it's show 404 not found.I have add follow setting.
<Directory {homedir}/httpdocs>
AllowOverride All
But it's still show 404 not found.
I have save it and run sync domain.Could I lost any action?

* take care, when editing, as it may cause apache to malfunction, so, also keep in mind a fallback scenario,
* after editing, go to ehcp gui->options -> sync domains
* this way, your new apachetemplate file will be activated.

* what your apache error logs show ? the error logs may show some more information about the error caused.

Not As simple as described here (ubuntu14 )
First try this

sudo a2enmod rewrite
sudo apache2ctl -M

to see that Mod_rewrite is working,

When you have verified the rewrite is not your problem move forward one step.

You have to hunt around etc/apache and www/new/ehcp/apachetemplate ,

apache2.conf and the sites enabled directory to get the correct "AllowOverride All" to work

note " sudo service apache2 restart " did not work for me,

only out of frustration I did a VPS reboot then all of a sudden It was Working !

Go Figure . . .?