DeveloperSide.NET Forums
July 13, 2020, 10:07:29 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: help wanted about url rewrite  (Read 3930 times)
0 Members and 1 Guest are viewing this topic.
dabin
Member
*
Posts: 1


View Profile
« on: March 11, 2006, 03:01:01 AM »

one question:

I want to make a change from current url:
http://localhost/newsite/cgi-bin/modperl_test.cgi
to new url http://localhost/newsite/
I don't want show the part "/cgi-bin/modperl_test.cgi"
only keep the part "http://localhost/newsite/" when I run cgi/perl scripts.
How can I do it? my httpd.conf file is:
###*********************************************************
###*  DeveloperSide.NET                                    *
###*  http://www.devside.net                               *
###*  admin@devside.net                                    *
###*  v1.16s                                               *
###*********************************************************


Listen 80
ServerRoot "/www/Apache2"

DocumentRoot "/www/webroot"

ServerName localhost:80
ServerAdmin admin@localhost

ServerSignature On
ServerTokens Full

DefaultType text/plain
AddDefaultCharset ISO-8859-1

UseCanonicalName Off

HostnameLookups Off

ErrorLog logs/error.log
LogLevel warn

PidFile logs/httpd.pid

Timeout 300

KeepAlive On
MaxKeepAliveRequests 100
KeepAliveTimeout 15


<IfModule mpm_winnt.c>
   ThreadsPerChild 250
   MaxRequestsPerChild 0
</IfModule>


LoadModule access_module modules/mod_access.so
#LoadModule actions_module modules/mod_actions.so
LoadModule alias_module modules/mod_alias.so
#LoadModule asis_module modules/mod_asis.so
LoadModule auth_module modules/mod_auth.so
#LoadModule auth_anon_module modules/mod_auth_anon.so
#LoadModule auth_dbm_module modules/mod_auth_dbm.so
#LoadModule auth_digest_module modules/mod_auth_digest.so
LoadModule autoindex_module modules/mod_autoindex.so
#LoadModule cern_meta_module modules/mod_cern_meta.so
LoadModule cgi_module modules/mod_cgi.so
#LoadModule dav_module modules/mod_dav.so
#LoadModule dav_fs_module modules/mod_dav_fs.so
LoadModule dir_module modules/mod_dir.so
#LoadModule env_module modules/mod_env.so
#LoadModule expires_module modules/mod_expires.so
#LoadModule file_cache_module modules/mod_file_cache.so
LoadModule headers_module modules/mod_headers.so
#LoadModule imap_module modules/mod_imap.so
#LoadModule include_module modules/mod_include.so
LoadModule info_module modules/mod_info.so
#LoadModule isapi_module modules/mod_isapi.so
LoadModule log_config_module modules/mod_log_config.so
LoadModule mime_module modules/mod_mime.so
#LoadModule mime_magic_module modules/mod_mime_magic.so
#LoadModule proxy_module modules/mod_proxy.so
#LoadModule proxy_connect_module modules/mod_proxy_connect.so
#LoadModule proxy_http_module modules/mod_proxy_http.so
#LoadModule proxy_ftp_module modules/mod_proxy_ftp.so
#LoadModule negotiation_module modules/mod_negotiation.so
LoadModule rewrite_module modules/mod_rewrite.so
LoadModule setenvif_module modules/mod_setenvif.so
#LoadModule speling_module modules/mod_speling.so
LoadModule status_module modules/mod_status.so
#LoadModule unique_id_module modules/mod_unique_id.so
#LoadModule userdir_module modules/mod_userdir.so
#LoadModule usertrack_module modules/mod_usertrack.so
#LoadModule vhost_alias_module modules/mod_vhost_alias.so

<IfDefine SSL>
   LoadModule ssl_module modules/mod_ssl.so
</IfDefine>
LoadModule logio_module modules/mod_logio.so
LoadModule deflate_module modules/mod_deflate.so

LoadFile "/www/perl/bin/perl58.dll"
LoadModule perl_module modules/mod_perl.so
PerlRequire "/www/Apache2/conf/extra.pl"

LoadFile "/www/php5/php5ts.dll"
LoadModule php5_module /www/php5/php5apache2.dll

LoadModule security_module modules/mod_security.dll

# Uncomment the below line ONLY after you have met the...
# Prerequisites -- Requirements for Tomcat
#LoadModule jk_module modules/mod_jk.so

<IfModule mod_jk.c>

   JkWorkersFile conf/workers.properties
   JkLogFile logs/mod_jk.log
   JkLogLevel error
   JkLogStampFormat "[%a %b %d %H:%M:%S %Y] "
   JkOptions +ForwardKeySize +ForwardURICompat -ForwardDirectories
   JkRequestLogFormat "%w %V %T"

   Alias /jsp-examples "/www/tomcat5/webapps/jsp-examples/"

   <Directory "/www/tomcat5/webapps/jsp-examples/">
      Options Indexes +FollowSymLinks
      AllowOverride None
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1
   </Directory>

   Alias /servlets-examples "/www/tomcat5/webapps/servlets-examples/"

   <Directory "/www/tomcat5/webapps/servlets-examples/">
      Options Indexes +FollowSymLinks
      AllowOverride None
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1
   </Directory>

   <Location /*/WEB-INF/*>
     AllowOverride None
     deny from all
   </Location>

   JkMount /jsp-examples/*.jsp example
   JkMount /servlets-examples/* example

</IfModule>


<IfModule mod_security.c>

# Uncommenting all rulesets will slow down Apache
# The most relevent/useful rulesets are set
# Ruleset Version: up to 20060117-01

   # Turns on and configures mod_security
   Include conf/modsec/modsec.conf

   # Exclusion rules
   Include conf/modsec/exclude.conf

   # Application protection rules
   Include conf/modsec/rules.conf

   # Comment spam rules
#   Include conf/modsec/blacklist.conf

   # Bad hosts, bad proxies and other bad players
#   Include conf/modsec/blacklist2.conf

   # Bad clients, known bogus useragents and other signs of malware
   Include conf/modsec/useragents.conf

   # Known bad software, rootkits and other malware
   Include conf/modsec/rootkits.conf

   # Signatures to prevent proxying through your server
   # Only set these rules if your server is NOT a proxy
#   Include conf/modsec/proxy.conf

   # Additional rules for Apache 2.x
   Include conf/modsec/apache2-rules.conf

   # Open proxies and other bad players
#   Include conf/modsec/badips.conf

   # Windows only rules
#   Include conf/modsec/windows-rules.conf

   # Search Engine Recon/Google Hacks Security Rules
#   Include conf/modsec/recons.conf

</IfModule>


<Location />
   <IfModule mod_deflate.c>
      AddOutputFilterByType DEFLATE text/html text/plain text/css
      <IfModule mod_headers.c>
         Header append Vary User-Agent
      </IfModule>
   </IfModule>
</Location>


<Directory />
   Options None
   AllowOverride All
   Order allow,deny
   Deny from all
</Directory>


# If the use of htaccess files are not needed,
# remove the next five lines for security reasons.

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


<Directory "/www/webroot">
# If listing of files and directories or the use of htaccess files are not needed,
# remove the next two lines for security reasons.

   Options Indexes
   AllowOverride All   
   Order allow,deny
   Allow from all
</Directory>

<IfModule mod_auth.c>
   <Files ~ "^\.ht">
      Order allow,deny
      Deny from all
   </Files>

   Alias /private "/www/private"

   <Directory "/www/private">
      <IfModule mod_autoindex.c>
         Options Indexes
      </IfModule>

      Order allow,deny
      Allow from all

      AuthType Basic
      AuthName "Private Access"
      AuthUserFile "/www/private/.htpasswd"
      require valid-user
   </Directory>
</IfModule>

###############################################################

Alias /newsite "F:/MySites/Newsite"
<Directory "F:/MySites/Newsite">
    Options Indexes
    AllowOverride All
    Order allow,deny
    Allow from all
</Directory>

#################################################################

############################################################################

AddHandler cgi-script .cgi .pl
<IfModule mod_cgi.c>
   ScriptAlias /newsite/cgi-bin/ "F:/MySites/Newsite/cgi-bin"
   <Directory "F:/MySites/Newsite/cgi-bin">
      Options ExecCGI
      AllowOverride All
      Order allow,deny
      Allow from all
   </Directory>
</IfModule>


#############################################################################

#<ScriptAlias /cgi-bin/ "/www/cgi-bin/"
#   <Directory "/www/cgi-bin">
#      Options None
#      AllowOverride None
#      Order allow,deny
#      Allow from all
#   </Directory>
#</IfModule>

###############################################################

Alias /phpMyAdmin "/www/phpMyAdmin"

<Directory "/www/phpMyAdmin">
   Options None
   AllowOverride None
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
</Directory>


<Directory "/www/webroot/stats">
   Order deny,allow
   Deny from all
   Allow from 127.0.0.1
</Directory>


<IfModule mod_log_config.c>
   LogFormat "%h %l %u %t \"%r\" %>s %O \"%{Referer}i\" \"%{User-agent}i\"" combined
   CustomLog logs/access.log combined
   <IfModule mod_deflate.c>
      DeflateFilterNote Input instream
      DeflateFilterNote Output outstream
      DeflateFilterNote Ratio ratio
      LogFormat '"%r" %{outstream}n/%{instream}n (%{ratio}n%%)' deflate
      CustomLog logs/deflate.log deflate
   </IfModule>
</IfModule>


<IfModule mod_dir.c>
   DirectoryIndex index.html index.htm index.php index.cgi
</IfModule>


<IfModule mod_mime.c>
   TypesConfig conf/mime.types
   AddType application/x-compress .Z
   AddType application/x-gzip .gz .tgz
   AddType application/x-rar-compressed .rar

   <IfModule mod_php5.c>
      AddType application/x-httpd-php .php
      AddType application/x-httpd-php-source .phps
   </IfModule>
</IfModule>


<IfModule mod_setenvif.c>
   BrowserMatch "Mozilla/2" nokeepalive
   BrowserMatch "MSIE 4\.0b2;" nokeepalive downgrade-1.0 force-response-1.0
   BrowserMatch "RealPlayer 4\.0" force-response-1.0
   BrowserMatch "Java/1\.0" force-response-1.0
   BrowserMatch "JDK/1\.0" force-response-1.0
   BrowserMatch "Microsoft Data Access Internet Publishing Provider" redirect-carefully
   BrowserMatch "^WebDrive" redirect-carefully
   BrowserMatch "^WebDAVFS/1.[012]" redirect-carefully
   BrowserMatch "^gnome-vfs" redirect-carefully
   <IfModule mod_deflate.c>
      BrowserMatch ^Mozilla/4 gzip-only-text/html
      BrowserMatch ^Mozilla/4\.0[678] no-gzip
      BrowserMatch \bMSIE !no-gzip !gzip-only-text/html
   </IfModule>
</IfModule>


<IfModule mod_status.c>
   ExtendedStatus On
   <Location /server-status>
      SetHandler server-status
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1
   </Location>
</IfModule>


<IfModule mod_info.c>
   <Location /server-info>
      SetHandler server-info
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1
   </Location>
</IfModule>


<IfModule mod_perl.c>
   PerlModule Apache2::Status
   <Location /perl-status>
      SetHandler perl-script
      PerlResponseHandler Apache2::Status
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1
   </Location>
</IfModule>


<IfModule mod_ssl.c>
   Include conf/ssl.conf
</IfModule>


##### Start -- mod_perl Hello example, \www\perl\site\lib\Apache2\Hello.pm
#
<IfModule mod_perl.c>
   PerlModule Apache2::Hello
   <Location /hello>
      SetHandler modperl
      PerlResponseHandler Apache2::Hello
      Order deny,allow
      Deny from all
      Allow from 127.0.0.1
   </Location>
</IfModule>
#
##### End -- mod_perl Hello example
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.9 | SMF © 2006-2009, Simple Machines LLC Valid XHTML 1.0! Valid CSS!