mms

Member
Aug 26, 2010
11
0
51
Hello
How can i activate mod_rewrite

there's only one code working
RewriteEngine on
RewriteCond %{HTTP_HOST} ^my ip [NC]
RewriteRule ^(.*)$ /~ll22ll/upload$1 [L,R=301]

=================================My htaccess=============
# -FrontPage-

IndexIgnore .htaccess */.??* *~ *# */HEADER* */README* */_vti*

<Limit GET POST>
order deny,allow
deny from all
allow from all
</Limit>
<Limit PUT DELETE>
order deny,allow
deny from all
</Limit>
AuthName ll22ll.com
AuthUserFile /home/ll22ll/public_html/_vti_pvt/service.pwd
AuthGroupFile /home/ll22ll/public_html/_vti_pvt/service.grp

<IfModule mod_security.c>
SecFilterEngine Off
SecFilterScanPOST Off
</IfModule>


RewriteEngine on
ExpiresActive On
ExpiresByType image/gif "access 1 week"
ExpiresByType image/jpg "access 1 week"
ExpiresByType image/jpeg "access 1 week"
ExpiresByType image/png "access 1 week"
ExpiresByType application/x-shockwave-flash "access 1 week"
ExpiresByType application/x-javascript "access 1 week"


RewriteEngine on
RewriteCond %{HTTP_HOST} ^my ip [NC]
RewriteRule ^(.*)$ /~ll22ll/upload$1 [L,R=301]

it's not working i get 404 page
RewriteEngine on
RewriteRule ^view\/([0-9]+)\/(.*)$ do.php?id=$1
RewriteRule ^download\/([0-9]+)\/(.*)$ do.php?id=$1
RewriteRule ^delete\/([0-9]+)\/(.*)$ go.php?go=del&cd=$2
RewriteRule ^([0-9]+)/folder/([0-9]+)$ index.php
RewriteRule ^([0-9]+)$ index.php
RewriteRule ^status.php$ go.php?go=rules
RewriteRule ^status.php?do=status$ go.php?go=stats



i Spock with the support they told me
Hello,

you will need to check apache documentation for mod_rewrite.

Ticket Details
how

thanks
 
Last edited:

kuldeep_

Well-Known Member
Apr 24, 2010
54
0
56
If you are sure that rules you have mentioned are correct then refer to following steps:

If you have root access to server then check if mod_rewrite is enabled on server.

To check use following command.
[email protected] [~]# httpd -l |grep mod_rewrite
mod_rewrite.c
If mod_rewrite is installed and still rules not working then try placing the rule in the top section of .htaccess file. Or comment out other rules for checking and only keep rules active that are not working and give it a try.
 

JaredR.

Well-Known Member
Feb 25, 2010
1,834
23
143
Houston, TX
cPanel Access Level
Root Administrator
mod_rewrite is included by default

mod_rewrite is included by default in the Apache that is built by EasyApache. It is compiled in so there is no LoadModule or AddModule directive in the httpd.conf file. To confirm that it is present, you can use httpd -l and then use grep to narrow down the output:

Code:
# /usr/local/apache/bin/httpd -l|grep rewrite
  mod_rewrite.c
mod_rewrite uses regex to match patterns. What I would suggest is using an online mod_rewrite testing tool to evaluate the patterns you are trying to use. A Google search for "mod_rewrite tester" returned some good possibilities at the top of the search results, such as the following:

Test your RewriteRules for Apache mod_rewrite
 

mms

Member
Aug 26, 2010
11
0
51
/root$ httpd -l |grep mod_rewrite
mod_rewrite.c

Linux Apache mod_rewrte Test Tutorial

Please Give Us Your Comments

LINK 1 = LINK 1 Does NOT use Mod Rewrite. LINK 1 uses standard URL: rewrite.php?link=1
i get
You are not using mod_rewrite - Try LINK2

LINK 2 = LINK 2 - Yes, Uses Apache's Mod Rewrite using this URL:: link2.html
404 Not Found

The server can not find the requested page:
My ip/~ll22ll/link2.html (port 80)

Apache Error logos
Code:
[Thu Aug 26 13:26:39 2010] [error] [client ] File does not exist: /usr/local/apache/htdocs/home
[Thu Aug 26 13:26:45 2010] [error] [client my ip] File does not exist: /home/ll22ll/public_html/upload/sys_cpanel, referer: http:///~ll22ll/upload/status.php

[Thu Aug 26 13:40:48 2010] [error] [client my ip] File does not exist: /usr/local/apache/htdocs/home
[Thu Aug 26 13:40:48 2010] [error] [client my ip] File does not exist: /home/ll22ll/public_html/sys_cpanel, referer: http:///~ll22ll/link2.html
Hello................
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
The server can not find the requested page:
My ip/~ll22ll/link2.html (port 80)
Have you ensured the desired URL can be accessed directly, before setting the redirect to use it in the Apache .htaccess file? The URL being entered requires mod_userdir URLs to be allowed/enabled, but this can only be configured via root (Administrator) access to WebHost Manager (WHM) or manually via root SSH/console access.

Please test to verify if you can access URLs like the following without receiving an error; replacing "$server" with the server hostname or IP address and replace "$username" with your cPanel account username:
Code:
http://$server/~$username/
 

mms

Member
Aug 26, 2010
11
0
51
Have you ensured the desired URL can be accessed directly, before setting the redirect to use it in the Apache .htaccess file? The URL being entered requires mod_userdir URLs to be allowed/enabled, but this can only be configured via root (Administrator) access to WebHost Manager (WHM) or manually via root SSH/console access.

Please test to verify if you can access URLs like the following without receiving an error; replacing "$server" with the server hostname or IP address and replace "$username" with your cPanel account username:
Code:
http://$server/~$username/
it's working fine
my ip/~ll22ll

but after i add this line in http.conf
PHP:
LoadModule rewrite_module modules/mod_rewrite.so
i get after i tried to restart
Restarting Apache Web Server

Apache restart failed. Unable to load pid from pid file and no httpd process found in process list.

If apache restart reported success but it failed soon after, it may be caused by oddities with mod_ssl.

You should run /scripts/ssl_crt_status as part of your troubleshooting process. Pass it --help for more details.

Also be sure to examine apache's variouse log files.
Apache Restart Output:
httpd: Syntax error on line 38 of /usr/local/apache/conf/httpd.conf: module rewrite_module is built-in and can't be loaded

Log:
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
There is no extra configuration required in order to load "mod_rewrite" -- this module is compiled-into Apache when built/installed by EasyApache.

I recommend using a redirect destination of a domain name installed on the cPanel account instead of attempting to use mod_userdir URLs. Attempting to use mod_userdir and mod_rewrite can easily incur unnecessary difficulty.

What was used to configure your custom redirects? Were the entries input manually into the Apache .htaccess file(s) or were they setup by a script or some other method?
 

mms

Member
Aug 26, 2010
11
0
51
I just try to log in into cpanel by
http://my ip /cpanel
500 Internal Server Error ?
i can only log in cpanel
by
my ip:2026
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
I just try to log in into cpanel by
http://my ip /cpanel
500 Internal Server Error ?
i can only log in cpanel
by
my ip:2026
I recommend contacting your web hosting service provider so that they may assist with troubleshooting difficulty accessing cPanel; the service provider will have direct access to the server and they are in the best position to investigate and apply any necessary corrections.
 

mms

Member
Aug 26, 2010
11
0
51
When i try to update the

Easy::Apache v3.2.0 Build 5186

on
# 5. Short Options List
# →
# 6. Exhaustive Options List


there no option to activate the Mod_rewrite

whhhhhhhhhhhhhy
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
When i try to update the

Easy::Apache v3.2.0 Build 5186

on
# 5. Short Options List
# →
# 6. Exhaustive Options List

there no option to activate the Mod_rewrite

whhhhhhhhhhhhhy
As previously indicated, there is no additional configuration required to load the Apache/httpd module "mod_rewrite"; by default, mod_rewrite is -always- installed by EasyApache and it is not optional.
 

mms

Member
Aug 26, 2010
11
0
51
Okay but after i update the Apache
i get
easyapache3] Build Failure: Build id: 1282970491. Report id: 4111461
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
Okay but after i update the Apache
i get
easyapache3] Build Failure: Build id: 1282970491. Report id: 4111461
Thank you for the Build and Report ID information. It appears the build could not complete due to insufficient memory resources while attempting to compile the FileInfo module for PHP 5.3:
Code:
virtual memory exhausted: Cannot allocate memory
make: *** [ext/fileinfo/libmagic/apprentice.lo] Error 1
!! 'make' failed with exit code '512' !!
Please access the Exhaustive Options List in EasyApache and deselect, that is, disable, the FileInfo option for PHP 5.3. The FileInfo PHP module requires an unusually large amount of available memory (RAM) resources in order to compile successfully.

Please also ensure to remove any customizations from the Apache/httpd configuration:
[...] i add this line in http.conf
Code:
LoadModule rewrite_module modules/mod_rewrite.so
 

mms

Member
Aug 26, 2010
11
0
51
thanks now the build complete

some of threads on google
said the problem it could be form
# Mod Security
is that true
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
thanks now the build complete

some of threads on google
said the problem it could be form
# Mod Security
is that true
It is possibile for a mod_security rule to look for specific criteria and subsequently force a specific HTTP status code (such as 404: Not Found); however, if you're able to access the same mod_userdir URL directly I would then believe that the issue may stem from the specific redirect configuration of mod_rewrite entries in the applicable Apache .htaccess file(s).

If it is related to mod_security I recommend searching its audit log; this can be performed using WebHost Manager via the following menu path: WHM: Main >> Plugins >> Mod Security

The mod_security audit log can be monitored for new entries via root SSH/console access, and may be found at one of the following paths:
Code:
/usr/local/apache/logs/modsec_audit.log
/usr/local/apache/logs/audit_log
Here are two example commands for the above log paths:
Code:
# tail -fvn0 /usr/local/apache/logs/modsec_audit.log
# tail -fvn0 /usr/local/apache/logs/audit_log
 

mms

Member
Aug 26, 2010
11
0
51
I did up data the Apache with out the mod securty
but the problem still exists

i sent to host my problem "waiting for there replay "
 

mms

Member
Aug 26, 2010
11
0
51
they just sent me alot of msg

1
You have full root access to your server. Please check your configurations and server logs for more information about this problem.

2

Hello.

'mod_rewrite' is already installed for your Apache server.

3
Hello.

We cannot debug your code, please check 'mod_rewrite' documentation.

what's that

4
Hello,

you will need to check apache documentation for mod_rewrite.
5
Hello.

We have already give you all needed information.
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
I believe it is reasonable for the service provider to advise reading the official documentation for software such as Apache/httpd. To become more familiar with mod_rewrite I recommend carefully reviewing the following official Apache/httpd resources as noted below:
 

cPanelDon

cPanel Quality Assurance Analyst
Staff member
Nov 5, 2008
2,545
12
268
Houston, Texas, U.S.A.
cPanel Access Level
DataCenter Provider
Twitter
If cPanel was not yet used to setup any of the desired redirects, please rename or move the existing Apache .htaccess file(s) out of the way to start over, then setup ("from scratch") the desired redirects using cPanel via the following menu path (with linked documentation): cPanel: Main >> Domains >> Redirects
 

mms

Member
Aug 26, 2010
11
0
51
Thanks alot cPanelDon you wear cooperative with me
it's working now by adding
RewriteBase /~ll22ll/upload