Apache Development
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
User Name:
Password:
Remember me

The Shed is going Social! Join us on FaceBook and Twitter and chime in on the conversation.

Go Back   Dev Shed ForumsSystem AdministrationApache Development

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread Dev Shed Forums Sponsor:
  #1  
Old March 1st, 2013, 07:27 AM
mayank-rana mayank-rana is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 6 mayank-rana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 2 sec
Reputation Power: 0
general - Apache Rewrite Not Working

I am trying to make some of the site URLs SEO friendly, so {domain}/watches/collection/casio should be internally redirected to {domain}/watches/collection.list?brand=Casio

I have added the following line in httpd.conf file and restarted Apache but the request doesn't get redirected.

RewriteRule ^watches/collection/casio/?$ watches/collection.list?brand=Casio [NC,L]
Please note that I was able to add some Rewrite rules in my httpd.conf file which appends www and change the domain from .co.in to .com and both these changes are working fine, so I know the basics are all set up correctly, for example mod_jk is loaded etc.

Please help!

Reply With Quote
  #2  
Old March 1st, 2013, 12:27 PM
requinix's Avatar
requinix requinix is offline
Still alive
Dev Shed God 16th Plane (12500 - 12999 posts)
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,864 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 5 Days 5 h 56 m 54 sec
Reputation Power: 8977
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
This should not go in the httpd.conf. That's for the entire server setup. URL rewriting goes in the virtualhost configuration or a .htaccess.

Do you intend to put a rewriting rule for every single brand? I sure hope not. Can collection.list work with brand=casio (ie, lowercase)? Because "casio" is what's in your URL, not "Casio".

Reply With Quote
  #3  
Old March 3rd, 2013, 02:51 AM
mayank-rana mayank-rana is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 6 mayank-rana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
This should not go in the httpd.conf. That's for the entire server setup. URL rewriting goes in the virtualhost configuration or a .htaccess.

Do you intend to put a rewriting rule for every single brand? I sure hope not. Can collection.list work with brand=casio (ie, lowercase)? Because "casio" is what's in your URL, not "Casio".


My virtual hosts are defined inside httpd.conf file and I have defined the RewriteRules inside virtual hosts itself, instead of htaccess file for performance issues.

Also, I am sure "Casio" works fine in the URL as the underlying controller handles such requests case-insensitively.

Reply With Quote
  #4  
Old March 3rd, 2013, 03:21 AM
requinix's Avatar
requinix requinix is offline
Still alive
Dev Shed God 16th Plane (12500 - 12999 posts)
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,864 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 5 Days 5 h 56 m 54 sec
Reputation Power: 8977
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Eh, fair enough. I didn't consider that.

The URL that RewriteRule matches against sometimes starts with a slash. Adding in some capturing-ness for "casio" you can
Code:
RewriteRule ^/?watches/collection/([^/]+)/?$ watches/collection.list?brand=$1 [NC,L]

Does put the onus on collection.list to do a 404 (or a redirect) if the brand doesn't exist.

Reply With Quote
  #5  
Old March 3rd, 2013, 07:53 AM
mayank-rana mayank-rana is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 6 mayank-rana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
Eh, fair enough. I didn't consider that.

The URL that RewriteRule matches against sometimes starts with a slash. Adding in some capturing-ness for "casio" you can
Code:
RewriteRule ^/?watches/collection/([^/]+)/?$ watches/collection.list?brand=$1 [NC,L]

Does put the onus on collection.list to do a 404 (or a redirect) if the brand doesn't exist.


Thanks. Tried this too but still no luck. Even tried changing the order of the rules but that's no good either. I am losing the will to live now!

Reply With Quote
  #6  
Old March 3rd, 2013, 04:35 PM
requinix's Avatar
requinix requinix is offline
Still alive
Dev Shed God 16th Plane (12500 - 12999 posts)
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,864 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 5 Days 5 h 56 m 54 sec
Reputation Power: 8977
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
You are restarting Apache after all these changes, right?

Reply With Quote
  #7  
Old March 4th, 2013, 12:51 AM
mayank-rana mayank-rana is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 6 mayank-rana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
You are restarting Apache after all these changes, right?


Yes, I am

Reply With Quote
  #8  
Old March 4th, 2013, 12:15 PM
requinix's Avatar
requinix requinix is offline
Still alive
Dev Shed God 16th Plane (12500 - 12999 posts)
 
Join Date: Mar 2007
Location: Washington, USA
Posts: 12,864 requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)requinix User rank is General 120th Grade (Above 100000 Reputation Level)  Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1Folding Points: 417516 Folding Title: Super Ultimate Folder - Level 1
Time spent in forums: 5 Months 1 Week 5 Days 5 h 56 m 54 sec
Reputation Power: 8977
Send a message via AIM to requinix Send a message via MSN to requinix Send a message via Yahoo to requinix Send a message via Google Talk to requinix
Okay, let's start at the top.

Try a simpler
Code:
RewriteRule watches watches/collection.list?brand=casio [NC,L]

With that, every URL containing "watches" anywhere should go to the Casio page. Does that happen?

And in case there's something else going on, what's the rest of the httpd.conf? Just the stuff related to the site itself, not the whole configuration.

Reply With Quote
  #9  
Old March 5th, 2013, 03:08 AM
mayank-rana mayank-rana is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 6 mayank-rana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 2 sec
Reputation Power: 0
Quote:
Originally Posted by requinix
Okay, let's start at the top.

Try a simpler
Code:
RewriteRule watches watches/collection.list?brand=casio [NC,L]

With that, every URL containing "watches" anywhere should go to the Casio page. Does that happen?

And in case there's something else going on, what's the rest of the httpd.conf? Just the stuff related to the site itself, not the whole configuration.


I like this approach... starting from the simplest! Well, I tried this but that didn't work either, but I got an apache error this time, so I guess mod_jk is not doing its job correctly when these redirects. I will post the httpd conf later tonight when I will be working on this issue, as I can only play around with this during off-peak hours Thanks

Reply With Quote
  #10  
Old March 7th, 2013, 06:58 AM
mayank-rana mayank-rana is offline
Registered User
Dev Shed Newbie (0 - 499 posts)
 
Join Date: Mar 2013
Posts: 6 mayank-rana User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 1 h 31 m 2 sec
Reputation Power: 0
After a bit of more playing around, I get a following error when I try to hit /watches/collection/casio

Code:
Bad Request

Your browser sent a request that this server could not understand.
Additionally, a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.

Apache/2.2.23 (Unix) mod_ssl/2.2.23 OpenSSL/0.9.8e-fips-rhel5 mod_jk/1.2.35 FrontPage/5.0.2.2635 mod_bwlimited/1.4 mod_auth_passthrough/2.1 Server at www.bazaardelight.com Port 80


The complete httpd.conf is as below

Code:
Include "/usr/local/apache/conf/includes/pre_main_global.conf"
Include "/usr/local/apache/conf/includes/pre_main_2.conf"
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#   Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the       #
#   configuration file. To have modifications retained, all modifications must be checked into the              #
#   configuration system by running:                                                                            #
#       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#   To see if your changes will be conserved, regenerate the Apache configuration file by running:              #
#       /usr/local/cpanel/bin/build_apache_conf                                                                 #
#   and check the configuration file for your alterations. If your changes have been ignored, then they will    #
#   need to be added directly to their respective template files.                                               #
#                                                                                                               #
#   It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf       #
#   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
#   system refer to the documentation at: http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html       #
#                                                                                                               #
#   This configuration file was built from the following templates:                                             #
#     /var/cpanel/templates/apache2/main.default                                                                #
#     /var/cpanel/templates/apache2/main.local                                                                  #
#     /var/cpanel/templates/apache2/vhost.default                                                               #
#     /var/cpanel/templates/apache2/vhost.local                                                                 #
#     /var/cpanel/templates/apache2/ssl_vhost.default                                                           #
#     /var/cpanel/templates/apache2/ssl_vhost.local                                                             #
#                                                                                                               #
#  Templates with the '.local' extension will be preferred over templates with the '.default' extension.        #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #





LoadModule jk_module modules/mod_jk.so
LoadModule frontpage_module modules/mod_frontpage.so
LoadModule bwlimited_module modules/mod_bwlimited.so
LoadModule auth_passthrough_module modules/mod_auth_passthrough.so




Include "/usr/local/apache/conf/jk.conf"
Include "/usr/local/apache/conf/php.conf"
Include "/usr/local/apache/conf/includes/errordocument.conf"


ErrorLog "logs/error_log"
DefaultType text/plain
ScriptAliasMatch ^/?controlpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?cpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?kpanel/?$ /usr/local/cpanel/cgi-sys/redirect.cgi
ScriptAliasMatch ^/?securecontrolpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?securecpanel/?$ /usr/local/cpanel/cgi-sys/sredirect.cgi
ScriptAliasMatch ^/?securewhm/?$ /usr/local/cpanel/cgi-sys/swhmredirect.cgi
ScriptAliasMatch ^/?webmail/?$ /usr/local/cpanel/cgi-sys/wredirect.cgi
ScriptAliasMatch ^/?whm/?$ /usr/local/cpanel/cgi-sys/whmredirect.cgi

Alias /akopia /usr/local/cpanel/3rdparty/interchange/share/akopia/
Alias /bandwidth /usr/local/bandmin/htdocs/
Alias /img-sys /usr/local/cpanel/img-sys/
Alias /interchange /usr/local/cpanel/3rdparty/interchange/share/interchange/
Alias /interchange-5 /usr/local/cpanel/3rdparty/interchange/share/interchange-5/
Alias /java-sys /usr/local/cpanel/java-sys/
Alias /mailman/archives /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /pipermail /usr/local/cpanel/3rdparty/mailman/archives/public/
Alias /sys_cpanel /usr/local/cpanel/sys_cpanel/


ScriptAlias /cgi-sys /usr/local/cpanel/cgi-sys/
ScriptAlias /mailman /usr/local/cpanel/3rdparty/mailman/cgi-bin/


<Directory "/">
    Options All
    AllowOverride All
</Directory>

<Directory "/usr/local/apache/htdocs">
    Options Includes Indexes FollowSymLinks
    AllowOverride None
    Order allow,deny
    Allow from all

</Directory>


<Files ~ "^error_log$">
    Order allow,deny
    Deny from all
    Satisfy All
</Files>

<FilesMatch "^\.ht">
    Order allow,deny
    Deny from all

    Satisfy All
</FilesMatch>

<IfModule log_config_module>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common

    CustomLog "logs/access_log" common

    <IfModule logio_module>
        LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\" %I %O" combinedio

    </IfModule>

</IfModule>

<IfModule alias_module>
    ScriptAlias /cgi-bin/ "/usr/local/apache/cgi-bin/"

</IfModule>

<Directory "/usr/local/apache/cgi-bin">
    AllowOverride None
    Options None
    Order allow,deny
    Allow from all

</Directory>

<IfModule mod_log_config.c>
    LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-Agent}i\"" combined
    LogFormat "%h %l %u %t \"%r\" %>s %b" common
    LogFormat "%{Referer}i -> %U" referer
    LogFormat "%{User-agent}i" agent

    CustomLog logs/access_log common

</IfModule>

<IfModule mime_module>
    TypesConfig conf/mime.types
    AddType application/x-compress .Z
    AddType application/x-gzip .gz .tgz

</IfModule>

# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #
#   Direct modifications to the Apache configuration file may be lost upon subsequent regeneration of the       #
#   configuration file. To have modifications retained, all modifications must be checked into the              #
#   configuration system by running:                                                                            #
#       /usr/local/cpanel/bin/apache_conf_distiller --update                                                    #
#   To see if your changes will be conserved, regenerate the Apache configuration file by running:              #
#       /usr/local/cpanel/bin/build_apache_conf                                                                 #
#   and check the configuration file for your alterations. If your changes have been ignored, then they will    #
#   need to be added directly to their respective template files.                                               #
#                                                                                                               #
#   It is also possible to add custom directives to the various "Include" files loaded by this httpd.conf       #
#   For detailed instructions on using Include files and the apache_conf_distiller with the new configuration   #
#   system refer to the documentation at: http://www.cpanel.net/support/docs/ea/ea3/customdirectives.html       #
#                                                                                                               #
#   This configuration file was built from the following templates:                                             #
#     /var/cpanel/templates/apache2/main.default                                                                #
#     /var/cpanel/templates/apache2/main.local                                                                  #
#     /var/cpanel/templates/apache2/vhost.default                                                               #
#     /var/cpanel/templates/apache2/vhost.local                                                                 #
#     /var/cpanel/templates/apache2/ssl_vhost.default                                                           #
#     /var/cpanel/templates/apache2/ssl_vhost.local                                                             #
#                                                                                                               #
#  Templates with the '.local' extension will be preferred over templates with the '.default' extension.        #
#  The only template updated by the apache_conf_distiller is main.default.                                      #
# # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # # #


PidFile logs/httpd.pid
LockFile logs/accept.lock
# Defined in /var/cpanel/cpanel.config: apache_port
Listen 0.0.0.0:80
User deploy
Group users
ExtendedStatus On
ServerAdmin arvind@email.com
ServerName host.email.com
LogLevel warn

# These can be set in WHM under 'Apache Global Configuration'
Timeout 300

ServerSignature On



<IfModule prefork.c>


</IfModule>







RewriteEngine on
RewriteMap LeechProtect prg:/usr/local/cpanel/bin/leechprotect
RewriteLock /usr/local/apache/logs/rewrite_lock

UserDir public_html

# DirectoryIndex is set via the WHM -> Service Configuration -> Apache Setup -> DirectoryIndex Priority
DirectoryIndex index.html.var index.htm index.html index.shtml index.xhtml index.wml index.perl index.pl index.plx index.ppl index.cgi index.jsp index.js index.jp index.php4 index.php3 index.php index.phtml default.htm default.html home.htm index.php5 Default.html Default.htm home.html

# SSLCipherSuite can be set in WHM under 'Apache Global Configuration'

SSLPassPhraseDialog  builtin
SSLSessionCache         dbm:/usr/local/apache/logs/ssl_scache
SSLSessionCacheTimeout  300
SSLMutex  file:/usr/local/apache/logs/ssl_mutex
SSLRandomSeed startup builtin
SSLRandomSeed connect builtin

    # Defined in /var/cpanel/cpanel.config: apache_ssl_port
    Listen 0.0.0.0:443
    AddType application/x-x509-ca-cert .crt
    AddType application/x-pkcs7-crl .crl


AddHandler cgi-script .cgi .pl .plx .ppl .perl
AddHandler server-parsed .shtml
AddType text/html .shtml
AddType application/x-tar .tgz
AddType text/vnd.wap.wml .wml
AddType image/vnd.wap.wbmp .wbmp
AddType text/vnd.wap.wmlscript .wmls
AddType application/vnd.wap.wmlc .wmlc
AddType application/vnd.wap.wmlscriptc .wmlsc

<Location /whm-server-status>
    SetHandler server-status
    Order deny,allow
    Deny from all
    Allow from 127.0.0.1
</Location>



# SUEXEC is supported

Include "/usr/local/apache/conf/includes/pre_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/pre_virtualhost_2.conf"

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
NameVirtualHost 171.21.218.918:80
NameVirtualHost 171.21.218.920:80
NameVirtualHost *
# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

<VirtualHost 171.21.218.918:80>
    ServerName host.email.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin arvind@email.com
    <IfModule mod_suphp.c>
        suPHP_UserGroup deploy users
    </IfModule>
</VirtualHost>


# Default vhost for unbound IPs

<VirtualHost *>
    ServerName host.email.com
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin arvind@email.com
    <IfModule mod_suphp.c>
        suPHP_UserGroup deploy users
    </IfModule>
</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.



# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

<VirtualHost 171.21.218.918:80>
    ServerName domain.co.in
    ServerAlias www.domain.co.in
    DocumentRoot /home/deploy/codebase
    ServerAdmin webmaster@domain.co.in
    UseCanonicalName Off
    Options -ExecCGI -Includes
    RemoveHandler cgi-script .cgi .pl .plx .ppl .perl
    CustomLog /usr/local/apache/domlogs/domain.co.in combined
    CustomLog /usr/local/apache/domlogs/domain.co.in-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User saurabhji # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup saurabhji saurabhji
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        <IfModule !mod_ruid2.c>
            SuexecUserGroup saurabhji saurabhji
        </IfModule>
    </IfModule>
    <IfModule mod_ruid2.c>
        RUidGid saurabhji saurabhji
    </IfModule>

#  Include "/usr/local/apache/conf/userdata/*.conf"  
  JkMount /* ajp12
  JkMount /* ajp13
  JkMount /*.jsp ajp12
  JkMount /*.jsp ajp13
#  Include "/usr/local/apache/conf/userdata/*.owner-root"

    RewriteEngine on

#    RewriteRule watches watches/collection.list?brand=Casio [NC,L]
     RewriteRule ^/?watches/collection/([^/]+)/?$ watches/collection.list?brand=$1 [NC,L]

    RewriteCond %{HTTP_HOST} ^domain\.com
    RewriteRule ^(.*)$ https://www.domain.com$1 [R=permanent,L]

    RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC] 
    RewriteRule   (.*)         http://www.domain.com/$1  [L,R=301]

    # To customize this VirtualHost use an include file at the following location
    # Include "/usr/local/apache/conf/userdata/std/2/saurabhji/domain.co.in/*.conf"

</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

<VirtualHost 171.21.218.920:80>
    ServerName domain.com
    ServerAlias www.domain.com
    DocumentRoot /home/deploy/codebase
   # DocumentRoot /home/deploy/
   #  DocumentRoot /home/shopx/public_html
    ServerAdmin webmaster@domain.com
    UseCanonicalName Off
    CustomLog /usr/local/apache/domlogs/domain.com combined
    CustomLog /usr/local/apache/domlogs/domain.com-bytes_log "%{%s}t %I .\n%{%s}t %O ."
    ## User shopx # Needed for Cpanel::ApacheConf
    <IfModule mod_suphp.c>
        suPHP_UserGroup shopx shopx
    </IfModule>
    <IfModule !mod_disable_suexec.c>
        <IfModule !mod_ruid2.c>
            SuexecUserGroup shopx shopx
        </IfModule>
    </IfModule>
    <IfModule mod_ruid2.c>
        RUidGid shopx shopx
    </IfModule>
    ScriptAlias /cgi-bin/ /home/deploy/codebase/cgi-bin/

 # Include "/usr/local/apache/conf/userdata/*.conf"  
  JkMount /* ajp12
  JkMount /* ajp13
  JkMount /*.jsp ajp12
  JkMount /*.jsp ajp13
  #Include "/usr/local/apache/conf/userdata/*.owner-root"

    RewriteEngine on

 #  RewriteRule watches watches/collection.list?brand=Casio [NC,L]
    RewriteRule ^/?watches/collection/([^/]+)/?$ watches/collection.list?brand=$1 [NC,L]

    RewriteCond %{HTTP_HOST} ^domain\.com
    RewriteRule ^(.*)$ https://www.domain.com$1 [R=permanent,L]

    RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC] 
    RewriteRule   (.*)         http://www.domain.com/$1  [L,R=301]

    Include "/usr/local/apache/conf/userdata/std/2/shopx/domain.com/*.conf"
</VirtualHost>

# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.

# SSL
<VirtualHost 171.21.218.920:443>
    ServerName domain.com
    ServerAlias www.domain.com
   # ServerAlias domain.co.in
    #ServerAlias www.domain.co.in

    # START DO NOT DELETE
  DocumentRoot  /home/shopx/public_html

#    DocumentRoot /home/deploy/public_html
    # END DO NOT DELETE

    ServerAdmin webmaster@domain.com
    ErrorLog /usr/local/apache/logs/ssl_error.log
    TransferLog /usr/local/apache/logs/ssl_access.log

    SSLEngine On
    SSLCertificateFile /usr/local/apache/conf/ssl.crt/www.domain.com.crt
    SSLCertificateChainFile /usr/local/apache/conf/ssl.crt/www.domain.com.ca.crt
    SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/www.domain.com.key

    # Fixes the Intermittant Server Errors associated with some versions of Windows Internet Explorer
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

    # START DO NOT DELETE
    JkMount /* ajp13secure
    JkMount /*.category ajp13secure
    JkMount /*.secure ajp13secure

    RewriteEngine on

#RewriteRule ^watches/collection/([^/]+)/?$ watches/collection.list?brand=$1 [NC,L]
RewriteRule ^/?watches/collection/([^/]+)/?$ watches/collection.list?brand=$1 [NC,L]

    RewriteCond %{HTTP_HOST} ^domain\.com
    RewriteRule ^(.*)$ https://www.domain.com$1 [R=permanent,L]

    RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
    RewriteRule   (.*)         https://www.domain.com/$1  [L,R=301]

   # END DO NOT DELETE
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup shopx shopx
    </IfModule>
</VirtualHost>            

# SSL
<VirtualHost 171.21.218.918:443>
    ServerName domain.co.in
    ServerAlias www.domain.co.in
   # ServerAlias domain.co.in
    #ServerAlias www.domain.co.in

    # START DO NOT DELETE
  DocumentRoot  /home/shopx/public_html

#    DocumentRoot /home/deploy/public_html
    # END DO NOT DELETE

    ServerAdmin webmaster@domain.com
    ErrorLog /usr/local/apache/logs/ssl_error.log
    TransferLog /usr/local/apache/logs/ssl_access.log

    SSLEngine On
    SSLCertificateFile /usr/local/apache/conf/ssl.crt/www.domain.com.crt
    SSLCertificateChainFile /usr/local/apache/conf/ssl.crt/www.domain.com.ca.crt
    SSLCertificateKeyFile /usr/local/apache/conf/ssl.key/www.domain.com.key

    # Fixes the Intermittant Server Errors associated with some versions of Windows Internet Explorer
    SetEnvIf User-Agent ".*MSIE.*" nokeepalive ssl-unclean-shutdown downgrade-1.0 force-response-1.0

    # START DO NOT DELETE
    JkMount /* ajp13secure
    JkMount /*.category ajp13secure
    JkMount /*.secure ajp13secure

    RewriteEngine on

#RewriteRule ^watches/collection/([^/]+)/?$ watches/collection.list?brand=$1 [NC,L]
RewriteRule ^/?watches/collection/([^/]+)/?$ watches/collection.list?brand=$1 [NC,L]

   RewriteCond %{HTTP_HOST} ^domain\.com
    RewriteRule ^(.*)$ https://www.domain.com$1 [R=permanent,L]

    RewriteCond %{HTTP_HOST} !^www.domain.com$ [NC]
    RewriteRule   (.*)         https://www.domain.com/$1  [L,R=301]

  # END DO NOT DELETE
    <IfModule !mod_disable_suexec.c>
        SuexecUserGroup shopx shopx
    </IfModule>
</VirtualHost>            



# DO NOT EDIT. AUTOMATICALLY GENERATED.  IF YOU NEED TO MAKE A CHANGE PLEASE USE THE INCLUDE FILES.
# CPANEL/WHM/WEBMAIL/WEBDISK PROXY SUBDOMAINS
<VirtualHost * 171.21.218.918:80 171.21.218.920:80>
    ServerName host.email.com
    ServerAlias cpanel.* whm.* webmail.* webdisk.*
    DocumentRoot /usr/local/apache/htdocs
    ServerAdmin arvind@email.com
    <IfModule mod_suphp.c>
        suPHP_UserGroup deploy users
    </IfModule>
    RewriteEngine On
    <IfModule core.c>
        SSLProxyEngine On
    </IfModule>
    RewriteCond %{HTTP_HOST} ^cpanel\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2083/$1 [P]
    RewriteCond %{HTTP_HOST} ^webmail\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2096/$1 [P]
    RewriteCond %{HTTP_HOST} ^whm\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2087/$1 [P]
    RewriteCond %{HTTP_HOST} ^webdisk\.
    RewriteCond %{HTTPS} on
    RewriteRule ^/(.*) https://127.0.0.1:2078/$1 [P]
    RewriteCond %{HTTP_HOST} ^cpanel\.
    RewriteRule ^/(.*) http://127.0.0.1:2082/$1 [P]
    RewriteCond %{HTTP_HOST} ^webmail\.
    RewriteRule ^/(.*) http://127.0.0.1:2095/$1 [P]
    RewriteCond %{HTTP_HOST} ^whm\.
    RewriteRule ^/(.*) http://127.0.0.1:2086/$1 [P]
    RewriteCond %{HTTP_HOST} ^webdisk\.
    RewriteRule ^/(.*) http://127.0.0.1:2077/$1 [P]
    UseCanonicalName Off
</VirtualHost>
Include "/usr/local/apache/conf/includes/post_virtualhost_global.conf"
Include "/usr/local/apache/conf/includes/post_virtualhost_2.conf"

Reply With Quote
Reply

Viewing: Dev Shed ForumsSystem AdministrationApache Development > general - Apache Rewrite Not Working

Developer Shed Advertisers and Affiliates



Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump

Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 


Powered by: vBulletin Version 3.0.5
Copyright ©2000 - 2013, Jelsoft Enterprises Ltd.

© 2003-2013 by Developer Shed. All rights reserved. DS Cluster - Follow our Sitemap