Xampp default index php

Настроить локальный сервер XAMPP?

Когда ввожу адрес сайта site.ru или site.ru/ или site.ru/123 ,
к адресу автоматом добавляется /index.html/ ,
а так как на сайте нет такой страницы, то Error 404 .
Мне нужно чтобы по умолчанию , при обращении site.ru или site.ru/123/
сервер это понимал как site.ru/index.php или site.ru/123/index.php
все гонфиги уже пересмотрел — не могу найти где это настраивается,
нашёл только «что то похожее» , на то что нужно
в в файле /opt/lampp/etc/httpd.conf ,
НО вроде бы там всё нормально, поставил index.php в первую позицию (было index.html )
Не знаю где искать? где это настроить? (͡๏̯͡๏)
дело именно в сервере, а не в .htaccess (пробовал и без него)

 #DirectoryIndex index.html # XAMPP DirectoryIndex index.php index.html.var index.html index.php3 index.php4 
svm@svm ~ $ cat /opt/lampp/etc/httpd.conf |grep -v -E "#|^$" ServerRoot "/opt/lampp" Listen 80 LoadModule authn_file_module modules/mod_authn_file.so LoadModule authn_dbm_module modules/mod_authn_dbm.so LoadModule authn_anon_module modules/mod_authn_anon.so LoadModule authn_dbd_module modules/mod_authn_dbd.so LoadModule authn_socache_module modules/mod_authn_socache.so LoadModule authn_core_module modules/mod_authn_core.so LoadModule authz_host_module modules/mod_authz_host.so LoadModule authz_groupfile_module modules/mod_authz_groupfile.so LoadModule authz_user_module modules/mod_authz_user.so LoadModule authz_dbm_module modules/mod_authz_dbm.so LoadModule authz_owner_module modules/mod_authz_owner.so LoadModule authz_dbd_module modules/mod_authz_dbd.so LoadModule authz_core_module modules/mod_authz_core.so LoadModule authnz_ldap_module modules/mod_authnz_ldap.so LoadModule access_compat_module modules/mod_access_compat.so LoadModule auth_basic_module modules/mod_auth_basic.so LoadModule auth_form_module modules/mod_auth_form.so LoadModule auth_digest_module modules/mod_auth_digest.so LoadModule allowmethods_module modules/mod_allowmethods.so LoadModule file_cache_module modules/mod_file_cache.so LoadModule cache_module modules/mod_cache.so LoadModule cache_disk_module modules/mod_cache_disk.so LoadModule socache_shmcb_module modules/mod_socache_shmcb.so LoadModule socache_dbm_module modules/mod_socache_dbm.so LoadModule socache_memcache_module modules/mod_socache_memcache.so LoadModule dbd_module modules/mod_dbd.so LoadModule bucketeer_module modules/mod_bucketeer.so LoadModule dumpio_module modules/mod_dumpio.so LoadModule echo_module modules/mod_echo.so LoadModule case_filter_module modules/mod_case_filter.so LoadModule case_filter_in_module modules/mod_case_filter_in.so LoadModule buffer_module modules/mod_buffer.so LoadModule ratelimit_module modules/mod_ratelimit.so LoadModule reqtimeout_module modules/mod_reqtimeout.so LoadModule ext_filter_module modules/mod_ext_filter.so LoadModule request_module modules/mod_request.so LoadModule include_module modules/mod_include.so LoadModule filter_module modules/mod_filter.so LoadModule substitute_module modules/mod_substitute.so LoadModule sed_module modules/mod_sed.so LoadModule charset_lite_module modules/mod_charset_lite.so LoadModule deflate_module modules/mod_deflate.so LoadModule mime_module modules/mod_mime.so LoadModule ldap_module modules/mod_ldap.so LoadModule log_config_module modules/mod_log_config.so LoadModule log_debug_module modules/mod_log_debug.so LoadModule logio_module modules/mod_logio.so LoadModule env_module modules/mod_env.so LoadModule mime_magic_module modules/mod_mime_magic.so LoadModule cern_meta_module modules/mod_cern_meta.so LoadModule expires_module modules/mod_expires.so LoadModule headers_module modules/mod_headers.so LoadModule usertrack_module modules/mod_usertrack.so LoadModule unique_id_module modules/mod_unique_id.so LoadModule setenvif_module modules/mod_setenvif.so LoadModule version_module modules/mod_version.so LoadModule remoteip_module modules/mod_remoteip.so LoadModule proxy_module modules/mod_proxy.so LoadModule proxy_connect_module modules/mod_proxy_connect.so LoadModule proxy_ftp_module modules/mod_proxy_ftp.so LoadModule proxy_http_module modules/mod_proxy_http.so LoadModule proxy_fcgi_module modules/mod_proxy_fcgi.so LoadModule proxy_scgi_module modules/mod_proxy_scgi.so LoadModule proxy_ajp_module modules/mod_proxy_ajp.so LoadModule proxy_balancer_module modules/mod_proxy_balancer.so LoadModule proxy_express_module modules/mod_proxy_express.so LoadModule session_module modules/mod_session.so LoadModule session_cookie_module modules/mod_session_cookie.so LoadModule session_dbd_module modules/mod_session_dbd.so LoadModule slotmem_shm_module modules/mod_slotmem_shm.so LoadModule ssl_module modules/mod_ssl.so LoadModule lbmethod_byrequests_module modules/mod_lbmethod_byrequests.so LoadModule lbmethod_bytraffic_module modules/mod_lbmethod_bytraffic.so LoadModule lbmethod_bybusyness_module modules/mod_lbmethod_bybusyness.so LoadModule lbmethod_heartbeat_module modules/mod_lbmethod_heartbeat.so LoadModule unixd_module modules/mod_unixd.so LoadModule dav_module modules/mod_dav.so LoadModule status_module modules/mod_status.so LoadModule autoindex_module modules/mod_autoindex.so LoadModule info_module modules/mod_info.so LoadModule suexec_module modules/mod_suexec.so LoadModule cgi_module modules/mod_cgi.so LoadModule cgid_module modules/mod_cgid.so LoadModule dav_fs_module modules/mod_dav_fs.so LoadModule vhost_alias_module modules/mod_vhost_alias.so LoadModule negotiation_module modules/mod_negotiation.so LoadModule dir_module modules/mod_dir.so LoadModule actions_module modules/mod_actions.so LoadModule speling_module modules/mod_speling.so LoadModule userdir_module modules/mod_userdir.so LoadModule alias_module modules/mod_alias.so LoadModule rewrite_module modules/mod_rewrite.so LoadModule php4_module modules/libphp4.so LoadModule php5_module modules/libphp5.so User daemon Group daemon ServerAdmin you@example.com ServerName localhost AllowOverride All Require all denied DocumentRoot "/opt/lampp/htdocs" Options Indexes FollowSymLinks ExecCGI Includes AllowOverride All Require all granted DirectoryIndex index.php DirectoryIndex index.php index.html.var index.html index.php3 index.php4 Require all denied ErrorLog "logs/error_log" LogLevel warn LogFormat "%h %l %u %t \"%r\" %>s %b \"%i\" \"%i\"" combined LogFormat "%h %l %u %t \"%r\" %>s %b" common LogFormat "%h %l %u %t \"%r\" %>s %b \"%i\" \"%i\" %I %O" combinedio CustomLog "logs/access_log" common ScriptAlias /cgi-bin/ "/opt/lampp/cgi-bin/" AllowOverride None Options None Require all granted TypesConfig etc/mime.types AddType application/x-compress .Z AddType application/x-gzip .gz .tgz AddHandler cgi-script .cgi .pl AddType text/html .shtml AddOutputFilter INCLUDES .shtml EnableMMAP off EnableSendfile off Include etc/extra/httpd-multilang-errordoc.conf Include etc/extra/httpd-autoindex.conf Include etc/extra/httpd-vhosts.conf Include etc/extra/httpd-default.conf Include etc/extra/proxy-html.conf  Include etc/extra/httpd-ssl.conf  SSLRandomSeed startup builtin SSLRandomSeed connect builtin Include etc/extra/httpd-xampp.conf
svm@svm ~ $ cat /opt/lampp/etc/extra/httpd-xampp.conf |grep -v -E "#|^$" LoadModule php5_module modules/libphp5.so LoadModule perl_module modules/mod_perl.so Alias /phpmyadmin "/opt/lampp/phpmyadmin" AllowOverride AuthConfig Limit Require local ErrorDocument 403 /error/XAMPP_FORBIDDEN.html.var AddType application/x-httpd-php .php .php3 .php4 XBitHack on AddHandler perl-script .pl PerlHandler ModPerl::PerlRunPrefork PerlOptions +ParseHeaders PerlSendHeader On 
svm@svm ~ $ cat /opt/lampp/etc/extra/httpd-default.conf |grep -v -E "#|^$" Timeout 300 KeepAlive On MaxKeepAliveRequests 100 KeepAliveTimeout 5 UseCanonicalName Off AccessFileName .htaccess ServerTokens Full ServerSignature Off HostnameLookups Off RequestReadTimeout header=20-40,MinRate=500 body=20,MinRate=500 

Источник

Читайте также:  Thread java life cycles

How do I change default directory and index file for Apache (installed via XAMPP)

In order to get the url that you want working, you need to modify a file in windows (assuming you’re on windows 7) do the following: Launch notepad (or any other text editor) with administrative privileges Open the hosts file located at: C:\Windows\System32\drivers\etc Add the following entry to it: 127.0.0.1 vignesh In order to change the default page you need to change the apache configuration. So, you need to alter how Windows , rather than apache, resolves that address.

How do I change default directory and index file for Apache (installed via XAMPP)

The research link you pasted has the first part of the answer to your question, changing the path you want serve but the second part of your question, making it serve «myFile» as the Index is an additional step. See:

So you would add this line inside the relevant tags or even loose in the main httpd.conf file (see the Context section of the above link for valid places to use this directive):

Edit the httpd.conf file — the DocumentRoot directory can be updated to whichever directory you would like (and that the process has permissions to). See:

Php — Change Apache Default Index File, Change Apache Default Index File. Ask Question Asked 7 years, 4 months ago. Modified 7 years, 4 months ago. Viewed 12k times 2 I want apache2 to You do not need to restart Apache when you set .htaccess files. Your directive DirectoryIndex home.php should work.

Change Apache2 Default Index.html

Change Apache2 default Index.html file even if var/www/html path not visible inside root directory after pressing ctrl+h..

Читайте также:  Javascript label change text

Change Apache Default Index File

The best way is to add DirectoryIndex to your vhost configuration.

 DirectoryIndex home.php Allow Override All 

When you want to use that option ins your .htaccess file you have to set AllowOverride All in your vhost configuration. Otherwise you should get an error in your log DirectoryIndex not allowed here .

How do I change the default index page in Apache?, I recommend using .htaccess. You only need to add: DirectoryIndex home.php. or whatever page name you want to have for it. EDIT: basic htaccess tutorial. 1) Create .htaccess file in the directory where you want to change the index file. no extension. . in front, to ensure it is a «hidden» file. Enter the line above in … Usage exampleDirectoryIndex landing.html index.htmlFeedback

How do I set the default page of my website as index.html?

Yes, the DirectoryIndex directive in your Apache configuration must contain (among potential others) index.html

But it’s usually the default setting, so make sure your file is actually named index.html and not Index.html , index.HTML or any other case variant because *nix servers are case sensitive.

How to make Apache serve index.php instead of, I’m having exactly this same issue and couldn’t find where teh DirectoryIndex is. Work around i did is rename my index.html file to index.html.org and next thing is my index.php got picked up by browser. i still like to know where is this DirectoryIndex line is. i remember seeing it in 000-default.conf in sites …

Need to change the apache default home page

I think your question is split into 2 things: The ability to use http://vignesh as opposed to http://localhost:8080, and the option to change the default home page.

In order to get the url that you want working, you need to modify a file in windows (assuming you’re on windows 7) do the following:

  1. Launch notepad (or any other text editor) with administrative privileges
  2. Open the hosts file located at: C:\Windows\System32\drivers\etc
  3. Add the following entry to it: 127.0.0.1 vignesh

In order to change the default page you need to change the apache configuration.

  1. Open httpd.conf in your favorite text editor
  2. Locate the property called DirectoryIndex. Change it to the page that you want.

When you type an address in a browser, the browser relies on the operating system to resolve it. Only once it has been resolved, a request is sent to the actual server (in this case, your apache installation).

Because of this, you can’t alter how the «server» part is resolved through apache itself: it is your Windows system which handles that and, if appropriate (this is, if it resolves to localhost at the port where your apache is listening), forwards it to apache.

So, you need to alter how Windows , rather than apache, resolves that address. Fortunately, for your situation, it’s relatively easy to tweak, if you know what to look for (and I am telling you here, so you know 😉 ):

Open the file %SystemRoot%\system32\drivers\etc\hosts on a plain text editor, such as notepad ( %SystemRoot% is window’s base installation path, such as C:\Windows or C:\WinNT ), and add a line like this at the end:

Ubuntu server 18.04 apache2 how to change the default, I will keep this short. I am trying to figure out how to change the default page for apache2 to point at my oscommerce site instead by default. I have deleted the default index.html file. As of n

Источник

Оцените статью