之前apache中做日下配置,就可以实现伪静态
RewriteRule /([/d/D]*)/([/d/D]*)/(/w+)_for_(/w+).htm /$1/$2/$4.jsp?no=$3 [PT]
但是,今天安装了apache2.4.4之后,发现301跳转还好用,但是上边的这条伪静态找不到页面了...
apache日志中没有报错信息,只有access中一条记录
[05/May/2013:10:59:30 +0800] "GET /news/25382_for_gongsixinwen_text.htm HTTP/1.1" 404 234
感觉是http请求去找这个页面,没有找那个重写之后的页面
把配置贴全
<aclass="referer"target="_blank">@皮总
<preclass="brush:java;toolbar:true;auto-links:false;">##ThisisthemainApacheHTTPserverconfigurationfile.Itcontainsthe#configurationdirectivesthatgivetheserveritsinstructions.#See<URL:http://httpd.apache.org/docs/2.4/>fordetailedinformation.#Inparticular,see#<URL:http://httpd.apache.org/docs/2.4/mod/directives.html>#foradiscussionofeachconfigurationdirective.##DoNOTsimplyreadtheinstructionsinherewithoutunderstanding#whattheydo.They'rehereonlyashintsorreminders.Ifyouareunsure#consulttheonlinedocs.Youhavebeenwarned.##Configurationandlogfilenames:Ifthefilenamesyouspecifyformany#oftheserver'scontrolfilesbeginwith"/"(or"drive:/"forWin32),the#serverwillusethatexplicitpath.Ifthefilenamesdo notbegin#with"/",thevalueofServerRootisprepended--so"logs/access_log"#withServerRootsetto"/usr/local/apache2"willbeinterpretedbythe#serveras"/usr/local/apache2/logs/access_log",whereas"/logs/access_log"#willbeinterpretedas'/logs/access_log'.##ServerRoot:Thetopofthedirectorytreeunderwhichtheserver's#configuration,error,andlogfilesarekept.##Donotaddaslashattheendofthedirectorypath.Ifyoupoint#ServerRootatanon-localdisk,besuretospecifyalocaldiskonthe#Mutexdirective,iffile-basedmutexesareused.Ifyouwishtosharethe#sameServerRootformultiplehttpddaemons,youwillneedtochangeat#leastPidFile.#ServerRoot"/site01/program/apache"##Mutex:Allowsyoutosetthemutexmechanismandmutexfiledirectory#forindividualmutexes,orchangetheglobaldefaults##Uncommentandchangethedirectoryifmutexesarefile-basedandthedefault#mutexfiledirectoryisnotonalocaldiskorisnotappropriateforsome#otherreason.##Mutexdefault:logs##Listen:AllowsyoutobindApachetospecificIPaddressesand/or#ports,insteadofthedefault.Seealsothe<VirtualHost>#directive.##ChangethistoListenonspecificIPaddressesasshownbelowto#preventApachefromglommingontoallboundIPaddresses.##Listen12.34.56.78:80Listen80##DynamicSharedObject(DSO)Support##TobeabletousethefunctionalityofamodulewhichwasbuiltasaDSOyou#havetoplacecorrespondingLoadModule'linesatthislocationsothe#directivescontainedinitareactuallyavailable_before_theyareused.#Staticallycompiledmodules(thoselistedby
httpd-l')donotneed#tobeloadedhere.##Example:#LoadModulefoo_modulemodules/mod_foo.so#LoadModuleauthn_file_modulemodules/mod_authn_file.so#LoadModuleauthn_dbm_modulemodules/mod_authn_dbm.so#LoadModuleauthn_anon_modulemodules/mod_authn_anon.so#LoadModuleauthn_dbd_modulemodules/mod_authn_dbd.so#LoadModuleauthn_socache_modulemodules/mod_authn_socache.soLoadModuleauthn_core_modulemodules/mod_authn_core.soLoadModuleauthz_host_modulemodules/mod_authz_host.soLoadModuleauthz_groupfile_modulemodules/mod_authz_groupfile.soLoadModuleauthz_user_modulemodules/mod_authz_user.so#LoadModuleauthz_dbm_modulemodules/mod_authz_dbm.so#LoadModuleauthz_owner_modulemodules/mod_authz_owner.so#LoadModuleauthz_dbd_modulemodules/mod_authz_dbd.soLoadModuleauthz_core_modulemodules/mod_authz_core.soLoadModuleaccess_compat_modulemodules/mod_access_compat.soLoadModuleauth_basic_modulemodules/mod_auth_basic.so#LoadModuleauth_form_modulemodules/mod_auth_form.so#LoadModuleauth_digest_modulemodules/mod_auth_digest.so#LoadModuleallowmethods_modulemodules/mod_allowmethods.so#LoadModulefile_cache_modulemodules/mod_file_cache.so#LoadModulecache_modulemodules/mod_cache.so#LoadModulecache_disk_modulemodules/mod_cache_disk.so#LoadModulesocache_shmcb_modulemodules/mod_socache_shmcb.so#LoadModulesocache_dbm_modulemodules/mod_socache_dbm.so#LoadModulesocache_memcache_modulemodules/mod_socache_memcache.so#LoadModuledbd_modulemodules/mod_dbd.so#LoadModuledumpio_modulemodules/mod_dumpio.so#LoadModulebuffer_modulemodules/mod_buffer.so#LoadModuleratelimit_modulemodules/mod_ratelimit.soLoadModulereqtimeout_modulemodules/mod_reqtimeout.so#LoadModuleext_filter_modulemodules/mod_ext_filter.so#LoadModulerequest_modulemodules/mod_request.soLoadModuleinclude_modulemodules/mod_include.soLoadModulefilter_modulemodules/mod_filter.so#LoadModulesubstitute_modulemodules/mod_substitute.so#LoadModulesed_modulemodules/mod_sed.so#LoadModuledeflate_modulemodules/mod_deflate.soLoadModulemime_modulemodules/mod_mime.soLoadModulelog_config_modulemodules/mod_log_config.so#LoadModulelog_debug_modulemodules/mod_log_debug.so#LoadModulelogio_modulemodules/mod_logio.soLoadModuleenv_modulemodules/mod_env.so#LoadModuleexpires_modulemodules/mod_expires.soLoadModuleheaders_modulemodules/mod_headers.so#LoadModuleunique_id_modulemodules/mod_unique_id.soLoadModulesetenvif_modulemodules/mod_setenvif.soLoadModuleversion_modulemodules/mod_version.so#LoadModuleremoteip_modulemodules/mod_remoteip.so#LoadModuleproxy_modulemodules/mod_proxy.so#LoadModuleproxy_connect_modulemodules/mod_proxy_connect.so#LoadModuleproxy_ftp_modulemodules/mod_proxy_ftp.so#LoadModuleproxy_http_modulemodules/mod_proxy_http.so#LoadModuleproxy_fcgi_modulemodules/mod_proxy_fcgi.so#LoadModuleproxy_scgi_modulemodules/mod_proxy_scgi.so#LoadModuleproxy_ajp_modulemodules/mod_proxy_ajp.so#LoadModuleproxy_balancer_modulemodules/mod_proxy_balancer.so#LoadModuleproxy_express_modulemodules/mod_proxy_express.so#LoadModulesession_modulemodules/mod_session.so#LoadModulesession_cookie_modulemodules/mod_session_cookie.so#LoadModulesession_dbd_modulemodules/mod_session_dbd.so#LoadModuleslotmem_shm_modulemodules/mod_slotmem_shm.so#LoadModulessl_modulemodules/mod_ssl.so#LoadModulelbmethod_byrequests_modulemodules/mod_lbmethod_byrequests.so#LoadModulelbmethod_bytraffic_modulemodules/mod_lbmethod_bytraffic.so#LoadModulelbmethod_bybusyness_modulemodules/mod_lbmethod_bybusyness.so#LoadModulelbmethod_heartbeat_modulemodules/mod_lbmethod_heartbeat.soLoadModuleunixd_modulemodules/mod_unixd.so#LoadModuledav_modulemodules/mod_dav.soLoadModulestatus_modulemodules/mod_status.soLoadModuleautoindex_modulemodules/mod_autoindex.so#LoadModuleinfo_modulemodules/mod_info.so#LoadModulecgid_modulemodules/mod_cgid.so#LoadModuledav_fs_modulemodules/mod_dav_fs.so#LoadModulevhost_alias_modulemodules/mod_vhost_alias.so#LoadModulenegotiation_modulemodules/mod_negotiation.soLoadModuledir_modulemodules/mod_dir.so#LoadModuleactions_modulemodules/mod_actions.so#LoadModulespeling_modulemodules/mod_speling.so#LoadModuleuserdir_modulemodules/mod_userdir.soLoadModulealias_modulemodules/mod_alias.soLoadModulerewrite_modulemodules/mod_rewrite.so<IfModuleunixd_module>##Ifyouwishhttpdtorunasadifferentuserorgroup,youmustrun#httpdasrootinitiallyanditwillswitch.##User/Group:Thename(or#number)oftheuser/grouptorunhttpdas.#Itisusuallygoodpracticetocreateadedicateduserandgroupfor#runninghttpd,aswithmostsystemservices.#UserdaemonGroupdaemon</IfModule>#'Main'serverconfiguration##Thedirectivesinthissectionsetupthevaluesusedbythe'main'#server,whichrespondstoanyrequeststhataren'thandledbya#<VirtualHost>definition.Thesevaluesalsoprovidedefaultsfor#any<VirtualHost>containersyoumaydefinelaterinthefile.##Allofthesedirectivesmayappearinside<VirtualHost>containers,#inwhichcasethesedefaultsettingswillbeoverriddenforthe#virtualhostbeingdefined.###ServerAdmin:Youraddress,whereproblemswiththeservershouldbe#e-mailed.Thisaddressappearsonsomeserver-generatedpages,such#aserrordocuments.e.g.admin@your-domain.com#ServerAdminyou@example.com##ServerNamegivesthenameandportthattheserverusestoidentifyitself.#Thiscanoftenbedeterminedautomatically,butwerecommendyouspecify#itexplicitlytopreventproblemsduringstartup.##Ifyourhostdoesn'thavearegisteredDNSname,enteritsIPaddresshere.##ServerNamewww.example.com:80##Denyaccesstotheentiretyofyourserver'sfilesystem.Youmust#explicitlypermitaccesstowebcontentdirectoriesinother#<Directory>blocksbelow.#<Directory/>OptionsIndexesFollowSymLinksIncludesAllowOverrideNoneOrderallow,denyAllowfromallSatisfyall</Directory>##Notethatfromthispointforwardyoumustspecificallyallow#particularfeaturestobeenabled-soifsomething'snotworkingas#youmightexpect,makesurethatyouhavespecificallyenabledit#below.###DocumentRoot:Thedirectoryoutofwhichyouwillserveyour#documents.Bydefault,allrequestsaretakenfromthisdirectory,but#symboliclinksandaliasesmaybeusedtopointtootherlocations.#DocumentRoot"/site01/program/apache/htdocs"<Directory"/site01/program/apache/htdocs">##PossiblevaluesfortheOptionsdirectiveare"None","All",#oranycombinationof:#IndexesIncludesFollowSymLinksSymLinksifOwnerMatchExecCGIMultiViews##Notethat"MultiViews"mustbenamed
explicitly---"OptionsAll"#doesn'tgiveittoyou.##TheOptionsdirectiveisbothcomplicatedandimportant.Pleasesee#http://httpd.apache.org/docs/2.4/mod/core.html#options#formoreinformation.#OptionsIndexesFollowSymLinks##AllowOverridecontrolswhatdirectivesmaybeplacedin.htaccessfiles.#Itcanbe"All","None",oranycombinationofthekeywords:#AllowOverrideFileInfoAuthConfigLimit#AllowOverrideNone##Controlswhocangetstufffromthisserver.#Requireallgranted</Directory>##DirectoryIndex:setsthefilethatApachewillserveifadirectory#isrequested.#<IfModuledir_module>DirectoryIndexindex.htmlindex.jsp</IfModule>##Thefollowinglinesprevent.htaccessand.htpasswdfilesfrombeing#viewedbyWebclients.#<Files".ht*">Requirealldenied</Files>##ErrorLog:Thelocationoftheerrorlogfile.#IfyoudonotspecifyanErrorLogdirectivewithina<VirtualHost>#container,errormessagesrelatingtothatvirtualhostwillbe#loggedhere.Ifyou
dodefineanerrorlogfilefora<VirtualHost>#container,thathost'serrorswillbeloggedthereandnothere.#ErrorLog"logs/error_log"##LogLevel:Controlthenumberofmessagesloggedtotheerror_log.#Possiblevaluesinclude:debug,info,notice,warn,error,crit,#alert,emerg.#LogLevelwarn<IfModulelog_config_module>##Thefollowingdirectivesdefinesomeformatnicknamesforusewith#aCustomLogdirective(seebelow).#LogFormat"%h%l%u%t"%r"%>s%b"%{Referer}i""%{User-Agent}i""combinedLogFormat"%h%l%u%t"%r"%>s%b"common<IfModulelogio_module>#Youneedtoenablemod_logio.ctouse%Iand%OLogFormat"%h%l%u%t"%r"%>s%b"%{Referer}i""%{User-Agent}i"%I%O"combinedio</IfModule>##Thelocationandformatoftheaccesslogfile(CommonLogfileFormat).#Ifyoudonotdefineanyaccesslogfileswithina<VirtualHost>#container,theywillbeloggedhere.Contrariwise,ifyou
do#defineper-<VirtualHost>accesslogfiles,transactionswillbe#loggedthereinand
notinthisfile.#CustomLog"logs/access_log"common##Ifyoupreferalogfilewithaccess,agent,andrefererinformation#(CombinedLogfileFormat)youcanusethefollowingdirective.##CustomLog"logs/access_log"combined</IfModule><IfModulealias_module>##Redirect:Allowsyoutotellclientsaboutdocumentsthatusedto#existinyourserver'snamespace,butdonotanymore.Theclient#willmakeanewrequestforthedocumentatitsnewlocation.#Example:#Redirectpermanent/foohttp://www.example.com/bar##Alias:Mapswebpathsintofilesystempathsandisusedto#accesscontentthatdoesnotliveundertheDocumentRoot.#Example:#Alias/webpath/full/filesystem/path##Ifyouincludeatrailing/on/webpaththentheserverwill#requireittobepresentintheURL.Youwillalsolikely#needtoprovidea<Directory>sectiontoallowaccessto#thefilesystempath.##ScriptAlias:Thiscontrolswhichdirectoriescontainserverscripts.#ScriptAliasesareessentiallythesameasAliases,exceptthat#documentsinthetargetdirectoryaretreatedasapplicationsand#runbytheserverwhenrequestedratherthanasdocumentssenttothe#client.Thesamerulesabouttrailing"/"applytoScriptAlias#directivesastoAlias.#ScriptAlias/cgi-bin/"/site01/program/apache/cgi-bin/"</IfModule><IfModulecgid_module>##ScriptSock:Onthreadedservers,designatethepathtotheUNIX#socketusedtocommunicatewiththeCGIdaemonofmod_cgid.##Scriptsockcgisock</IfModule>##"/site01/program/apache/cgi-bin"shouldbechangedtowhateveryourScriptAliased#CGIdirectoryexists,ifyouhavethatconfigured.#<Directory"/site01/program/apache/cgi-bin">AllowOverrideNoneOptionsNoneRequireallgranted</Directory><IfModulemime_module>##TypesConfigpointstothefilecontainingthelistofmappingsfrom#filenameextensiontoMIME-type.#TypesConfigconf/mime.types##AddTypeallowsyoutoaddtooroverridetheMIMEconfiguration#filespecifiedinTypesConfigforspecificfiletypes.##AddTypeapplication/x-gzip.tgz##AddEncodingallowsyoutohavecertainbrowsersuncompress#informationonthefly.Note:Notallbrowserssupportthis.##AddEncodingx-compress.Z#AddEncodingx-gzip.gz.tgz##IftheAddEncodingdirectivesabovearecommented-out,thenyou#probablyshoulddefinethoseextensionstoindicatemediatypes:#AddTypeapplication/x-compress.ZAddTypeapplication/x-gzip.gz.tgz##AddHandlerallowsyoutomapcertainfileextensionsto"handlers":#actionsunrelatedtofiletype.Thesecanbeeitherbuiltintotheserver#oraddedwiththeActiondirective(seebelow)##TouseCGIscriptsoutsideofScriptAliaseddirectories:#(Youwillalsoneedtoadd"ExecCGI"tothe"Options"directive.)##AddHandlercgi-script.cgi#Fortypemaps(negotiatedresources):#AddHandlertype-mapvar##Filtersallowyoutoprocesscontentbeforeitissenttotheclient.##Toparse.shtmlfilesforserver-sideincludes(SSI):#(Youwillalsoneedtoadd"Includes"tothe"Options"directive.)#AddTypetext/html.htm.html.shtmAddOutputFilterINCLUDES.htm.html.shtm</IfModule>##Themod_mime_magicmoduleallowstheservertousevarioushintsfromthe#contentsofthefileitselftodetermineitstype.TheMIMEMagicFile#directivetellsthemodulewherethehintdefinitionsarelocated.##MIMEMagicFileconf/magic##Customizableerrorresponsescomeinthreeflavors:#1)plaintext2)localredirects3)externalredirects##Someexamples:#ErrorDocument500"Theservermadeabooboo."#ErrorDocument404/missing.html#ErrorDocument404"/cgi-bin/missing_handler.pl"#ErrorDocument402http://www.example.com/subscription_info.html###MaxRanges:MaximumnumberofRangesinarequestbefore#returningtheentireresource,oroneofthespecial#values'default','none'or'unlimited'.#Defaultsettingistoaccept200Ranges.#MaxRangesunlimited##EnableMMAPandEnableSendfile:Onsystemsthatsupportit,#memory-mappingorthesendfilesyscallmaybeusedtodeliver#files.Thisusuallyimprovesserverperformance,butmust#beturnedoffwhenservingfromnetworked-mounted#filesystemsorifsupportforthesefunctionsisotherwise#brokenonyoursystem.#Defaults:EnableMMAPOn,EnableSendfileOff##EnableMMAPoff#EnableSendfileon#Supplementalconfiguration##Theconfigurationfilesintheconf/extra/directorycanbe#includedtoaddextrafeaturesortomodifythedefaultconfigurationof#theserver,oryoumaysimplycopytheircontentshereandchangeas#necessary.#Server-poolmanagement(MPMspecific)#Includeconf/extra/httpd-mpm.conf#Multi-languageerrormessages#Includeconf/extra/httpd-multilang-errordoc.conf#Fancydirectorylistings#Includeconf/extra/httpd-autoindex.conf#Languagesettings#Includeconf/extra/httpd-languages.conf#Userhomedirectories#Includeconf/extra/httpd-userdir.conf#Real-timeinfoonrequestsandconfiguration#Includeconf/extra/httpd-info.conf#VirtualhostsIncludeconf/extra/httpd-vhosts.conf#LocalaccesstotheApacheHTTPServerManual#Includeconf/extra/httpd-manual.conf#Distributedauthoringandversioning(WebDAV)#Includeconf/extra/httpd-dav.conf#Variousdefaultsettings#Includeconf/extra/httpd-default.conf#Configuremod_proxy_htmltounderstandHTML4/XHTML1<IfModuleproxy_html_module>Includeconf/extra/proxy-html.conf</IfModule>#Secure(SSL/TLS)connections#Includeconf/extra/httpd-ssl.conf##Note:Thefollowingmustmustbepresenttosupport#startingwithoutSSLonplatformswithno/dev/randomequivalent#butastaticallycompiled-inmod_ssl.#<IfModulessl_module>SSLRandomSeedstartupbuiltinSSLRandomSeedconnectbuiltin</IfModule>##uncommentoutthebelowtodealwithuseragentsthatdeliberately#violateopenstandardsbymisusingDNT(DNT
mustbeaspecific#end-userchoice)##<IfModulesetenvif_module>#BrowserMatch"MSIE10.0;"bad_DNT#</IfModule>#<IfModuleheaders_module>#RequestHeaderunsetDNTenv=bad_DNT#</IfModule>includeconf/mod_jk.conf
你apache2.4下面的那个重写咋写的啊http://www.oschina.net/question/77331_2143982--帮忙看看,啥地方没写好啊,我也是在原来IIS里面,可以使用,可是换了服务器就不行了回复<aclass='referer'target='_blank'>@皮总:谢谢皮总,搞定了,我正则在windows下好用,linux不好用,换了个方式就好了还不够全啊,你的Rewrite相关的没有出来
版权声明:本文内容由阿里云实名注册用户自发贡献,版权归原作者所有,阿里云开发者社区不拥有其著作权,亦不承担相应法律责任。具体规则请查看《阿里云开发者社区用户服务协议》和《阿里云开发者社区知识产权保护指引》。如果您发现本社区中有涉嫌抄袭的内容,填写侵权投诉表单进行举报,一经查实,本社区将立刻删除涉嫌侵权内容。