Author Topic: .htaccess (mod rewrite) Rewrite not working - .htaccess being ignored by Apache  (Read 12704 times)

0 Members and 1 Guest are viewing this topic.

Offline
*
If you use mod rewrite and .htaccess for your website than you will need to add this in your vhost file (change USERNAME)

you need to edit where your domain is listed in file:
Code: [Select]
/etc/httpd/conf/httpd_webpanel_vhosts.conf
Add this:
Code: [Select]
<Directory "/home/USERNAME/public_html">
AllowOverride All
</Directory>

add this config beffore </VirtualHost> for your domain
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
hellow
Thank you for Developing CWP :)
Now I've got it installed!

I create a user and submit a domain
myDomain.com
by username
myUname
and
 .htaccess file on this domain root have this code:
----------------------------------------
Options -Indexes
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ index.php/$1 [L]
-----------------------------------------
rewrite mode not working in server... :(
I use this topic method
and
I add this code before <Virtualhost> of  myDomain.com
virtual host>>myip:2030/index.php?module=file_editor&file=/usr/local/apache/conf.d/vhosts.conf
-----------------------------------------
<Directory "/home/<myUname>/public_html">
AllowOverride All
</Directory>
-----------------and too in virtual host template--------------
And I reboot server! after changing configs
But It not worked and
500 Internal server occurred!

in CWP, Apache not installed as service and i can't upgrade it or install any mod_ with yum!!!
how to install mod_rewrite in CentOS 6.6 CWP ?

Offline
*
List of modules (also this is available in the admin panel!)
/usr/local/apache/bin/apachectl -M

Listed on FAQ page
http://centos-webpanel.com/faq

- Error Message 500 Internal Server Error
http://forum.centos-webpanel.com/php/suphp-500-internal-server-error/
AntiDDoS Protection (web + mail)
http://centos-webpanel.com/website-ddos-protection-proxy

Join our Development Team and get paid !
http://centos-webpanel.com/develope-modules-for-cwp


Services Monitoring & RBL Monitoring
http://centos-webpanel.com/services-monitor


Do you need Fast and FREE Support included for your CWP linux server?
http://centos-webpanel.com/noc-partner-list
Installation Instructions
http://centos-webpanel.com/installation-instructions
Get Fast Support Here
http://centos-webpanel.com/support-services

Offline
*
Hi, I am running this command but its say it is a new directory.

sudo vi /etc/httpd/conf/httpd_webpanel_vhosts.conf

My virtual server runnig CentOS 6.5(Final)

Edit: I solved the problem. In CWP Apache Settings there is a panel that configure the vhosts.
« Last Edit: December 30, 2014, 09:04:26 PM by Turga »

Offline
*
hello there

i have just installed CWP and i have same problem,i have checked vhost from panel ,
and also checked Fix Permissions. please help...



vhosts.conf :


# vhost_start baharan-melk.ir
<VirtualHost 208.67.16.18:8181>
ServerName baharan-melk.ir
ServerAlias www.baharan-melk.ir
ServerAdmin xxxxxxxx@yahoo.com
DocumentRoot "/home/marvik/public_html"
ScriptAlias /cgi-bin/ "/home/marvik/public_html/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/marvik/baharan-melk.ir/*.conf

<IfModule mod_suexec.c>
        SuexecUserGroup marvik marvik
</IfModule>

<IfModule mod_suphp.c>
        suPHP_UserGroup marvik marvik
        suPHP_ConfigPath /home/marvik
</IfModule>

<Directory "/home/marvik/public_html">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end baharan-melk.ir






# vhost_start test.baharan-melk.ir
<VirtualHost 208.67.16.18:80>
ServerName test.baharan-melk.ir
ServerAlias www.test.baharan-melk.ir
ServerAdmin xxxxxxxxxx@yahoo.com
DocumentRoot "/home/marvik/public_html/test"
ScriptAlias /cgi-bin/ /home/marvik/public_html/test/cgi-bin/
#
# Custom settings are loaded below this line (if any exist)
# Include "/usr/local/apache/conf/userdata/marvik/test.baharan-melk.ir/*.conf

<IfModule mod_suexec.c>
        SuexecUserGroup marvik marvik
</IfModule>

<IfModule mod_suphp.c>
        suPHP_UserGroup marvik marvik
</IfModule>

<Directory "/home/marvik/public_html/test">
        AllowOverride All
</Directory>

</VirtualHost>
# vhost_end test.baharan-melk.ir

Offline
*
Problem Solved by editing my .httaccess file

Offline
**
Hello, 301 redirects are not working. This is a very urgent issue. What should I do to help?

This worked before. But now it does not work.

Options +FollowSymlinks
RewriteEngine on
ReWriteCond %{HTTP_HOST} ^(www.)?old-domain.com$ [NC]
ReWriteRule ^(.*)$ http://www.new-domain.org/$1 [R=301,L]
______________________________________________________________________________

Now this code works.

RewriteEngine on
RewriteCond %{HTTP_HOST} !^www\.old-domain\.com
RewriteRule (.*) http://www.new-domain.org/$1 [R=301,L]
« Last Edit: January 03, 2017, 03:01:32 AM by blackstar »