[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x

Apache Web Server

19K

Solutions

14K

Contributors

The Apache HTTP Server is a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Typically Apache is run on a Unix-like operating system, but it is available for a wide variety of operating systems, including Linux, Novell NetWare, Mac OS-X and Windows. Released under the Apache License, Apache is open-source software.

Share tech news, updates, or what's on your mind.

Sign up to Post

Hello,

I want to redirect OLD author pages to new Author pages in my Wordpress site.

OLD URL: https://site.com/author/ebooks/
NEW URL: https://site.com/ebook-author/

I need help with the httaccess rule for this redirection using best SEO practice.

Thank you for your help!
0
CompTIA Cloud+
LVL 12
CompTIA Cloud+

The CompTIA Cloud+ Basic training course will teach you about cloud concepts and models, data storage, networking, and network infrastructure.

This is a follow-on to this question https://www.experts-exchange.com/questions/29120630/How-To-Enable-Rewrite-On-Linux-2.html - I followed the advice but forgot that wordpress will overwrite what is within the wordpress block so I am now moving it out of the block.

# END W3TC Page Cache core

RewriteCond %{QUERY_STRING} controller=product [NC]
RewriteCond %{QUERY_STRING} id_product=26 [NC]
RewriteRule ^/?index\.php$ /product/geranium-15-ml-100-pure-essential-oil/ [NC,R=301]

RewriteCond %{QUERY_STRING} controller=cms [NC]
RewriteCond %{QUERY_STRING} id_cms=([0-9]+)\%3F [NC]
RewriteRule ^/?index\.php$ /index.php?controller=cms&id_cms=%1 [NC,R=301]

RewriteCond %{QUERY_STRING} controller=product [NC]
RewriteCond %{QUERY_STRING} id_product=([0-9]+)\%3F [NC]
RewriteRule ^/?index\.php$ /index.php?controller=product&id_product=%1 [NC,R=301]

# BEGIN WordPress
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
</IfModule>

# END WordPress

Open in new window


The first re-write rule produces this error:  

https://gyazo.com/9741f64223879ee3f42407f1985e4d5e

The other 2 rules work fine so why is this rule not working and producing this error?
0
Hi, we have a site, seniormealsolutions.com, which for reasons I won't go into doesn't yet have an SSL certificate.

if you go to the http version, you get the proper site.

If you go to the https:// version, you see our main site, magickitchen.com, but with the seniormealsolutions.com still in the address window. I am worried that this will show to Google as duplicate content, would it?

I've tried various ways to redirect https to http, in .htaccess, with no success so far. here's what I've tried:
RewriteEngine on
RewriteCond %{HTTPS} on
RewriteRule ^/?$ http://%{SERVER_NAME}/ [R=301]
RewriteRule ^inner/directory/?$ http://%{SERVER_NAME}/inner/directory/ [R=301,L]

Open in new window



RewriteEngine on
RewriteCond %{HTTP:X-Forwarded-Proto} =https
RewriteRule ^(.*)$ http://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]

Open in new window


<VirtualHost *:443>
  SSLEnable

  RewriteEngine On
  RewriteCond %{HTTPS} on
  RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI}

</VirtualHost>

Open in new window


RewriteEngine On
RewriteCond %{SERVER_PORT} 443
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Open in new window


RewriteEngine On
RewriteCond %{HTTPS} on
RewriteRule (.*) http://%{HTTP_HOST}%{REQUEST_URI} [R=301,L]

Open in new window

0
Just got done creating a LAMP.  Then installed PHPMYADMIN.

Cannot log into PHPMYADMIN.  I have tried creating mySQL users, changing passwords, granting permissions, etc.

All attempts yield error 1045... access denied.

Thoughts?
0
I have an application that uses Apache running on a windows server that I need to create a certificate for. We have a 2008R2 server that is a CA that is trusted by all the machines in the domain. I understand the basic process of doing this, but all my research shows how to's that don't apply to my specific situation. (apache running on linux, submitting CSR to public CA etc.)
I'd like as step by step as possible as this is a production machine I'm meddling with. It can go down for an hour or a few without much impact, but I'd look bad.
0
Just installed WAMP on Windows 10. (There was no WAMP on my PC previously)

When I click the launch icon on my desktop, the command window opens for a few seconds and closes. The WAMP icon does not appear in the tray at the bottom right. (Although it did once, the first time, and it was Red).

I read somewhere (Google) that it could be a conflict with SkyPe also using Port 80. But my SkyPe is the latest version and Googling tells me that now you can't change (or see) the Port number on SkyPe!

What can I check please?

Thanks
0
awstats error 403 You don't have permission to access /awstats/awstats.pl on this server.
Apache error_log message:

AH01630: client denied by server configuration: /apps1/awstats-7.7/wwwroot/cgi-bin/awstats.pl
0
Linux. I need to set up a script that I can run via cron in the middle of every night to copy / back up specific folders into another directory. I want all folders, files and permissions and attributes copied. The goal is to have a 24 hour old copy that I can restore in case a user screws up their files. Example:

/usr/home/thisuser/web_master would be copied / backed up to /usr/home/mainuser
/usr/home/thisotheruser/web_master would be copied / backed up to /usr/home/mainuser
/usr/home/andanotheruser/web_master would be copied / backed up to /usr/home/mainuser

Each night, the copy / back up would overwrite the one from 24 hours ago.

How do I set this script up, and what type of file extension should the script be?
0
I am encountering an error when I try to install memcached on a PHP 7 - Linux AWS system.  This is the command I am using that generates the error.
yum install memcached php-pecl-memcache

Open in new window


This is 1 of 2 errors:
1.
Finished Dependency Resolution
Error: Package: php-pecl-memcache-3.0.8-4.amzn2.x86_64 (amzn2-core)
           Requires: php(api) = 20100412-64

Open in new window


2.  
Error: Package: php-pecl-memcache-3.0.8-4.amzn2.x86_64 (amzn2-core)
           Requires: php(zend-abi) = 20100525-64

Open in new window


Please help me with how to finish installing memcached.

Thanks,
0
I want http://server.mydomain.org to take me straight to the java app.
What do I need to do to make that happen?

http://server.mydomain.org takes me to the Tomcat GUI.
http://server.mydomain.org/javaapp takes me to the java app.

i'm using this conf file.  It's the only site enabled.
<VirtualHost server.mydomain.org>
ServerName server.mydomain.org
ServerAlias server.mydomain.org
ProxyRequests off
ProxyPreserveHost on
ProxyPass / http://server.mydomain.org:8080/
ProxyPassReverse / http://server.mydomain.org:8080/
</VirtualHost>


The usual stuff. This is not enabled.
000-default
<VirtualHost *80>
#ServerName www.example.com  commented out.
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR]/error.log
CustomLog $[APACHE_LOG_DIR]/access.log combined
</VirtualHOst>

#vim: syntax=apache ts=4 sw=4 sts=4 sr noet

Java 1.8.0
Tomcat 9.0.12
Apache 2.4
Debian 9.5

I have read doc's from Apache, and several from Digital Ocean, and others.
I just don't get it.
0
Learn Ruby Fundamentals
LVL 12
Learn Ruby Fundamentals

This course will introduce you to Ruby, as well as teach you about classes, methods, variables, data structures, loops, enumerable methods, and finishing touches.

Hi, our site techgardens.com has been super slow, I had a whole other long question about that and it was decided that it was largely the hosting.

But we're still on the same host, and the boss has started to use pingdom to monitor the site. We keep getting site down reports, and mostly they are for the reason could not find redirect location.

Could anyone help me figure out where that error is coming from? Pingdom is not very informational.
0
I'm having a heck of a time getting SSL to work on an Ubuntu 18.04 server using Apache2. I've installed Mediawiki to /var/www/html/wiki. I have a mediawiki.conf file that has virtual host entries for both 80 and 443. I have SSLEngine on and for the certificate file and the key file I have them pointed to the correct directory.

I'm having two issues:

1. If i type https://domain.com/wiki, it gives me a 404 not found, yet it fills in the /index.php/Main_Page at the end of the URL but the port says 80
2. If i type https://domain.com/wiki/index.php/Main_page it works and it uses 443. The issue with that is, I'm getting an error with chrome that says I'm getting mixed content. When i go to developer tools in chrome it's telling me that the .png file im using for the logo is not secure.

I haven't messed with ubuntu and apache2 for a while so i'm probably missing something, im just not sure what.

Thank you.
0
how can I add signature (name in cursive) to apache open office writer for windows 10
0
Hi, I was wondering if someone could please help me figure out a way to change the template's theme name as shown below, on the urls in the head section of my site without actually renaming the folders/directories on the template itself.

If I were to rename the folders on the actual template structure, everything would break, and even if it didn't, the automatic theme updates would not work, and for that reason, I need to figure out a way to mask, or rewrite the urls without breaking the theme template.

I have been searching online for a way to do this on my server, but no luck so far. Please help.

<link href="/templates/template-name/css/theme.9.css?v=1537979830" rel="stylesheet" id="theme-style-css" />
      <link href="/templates/template-name/css/theme.update.css?v=1.15.7" rel="stylesheet" id="theme-style-update-css" />
      <script src="/media/jui/js/jquery.min.js"></script>
      <script src="/media/jui/js/jquery-noconflict.js"></script>
      <script src="media/system/js/copyright.js"></script>
      <script src="/templates/template-name/vendor/assets/uikit/dist/js/uikit.min.js?v=1.15.7"></script>
      <script src="/templates/template-name/vendor/assets/uikit/dist/js/uikit-icons-fjord.min.js?v=1.15.7"></script>
      <script src="/templates/template-name/js/theme.js?v=1.15.7"></script>

My server configuration is as follows:

Red Hat Enterprise Linux Server 7.5

Plesk Onyx Version 17.8.11

PHP 7.2.11

Apache and FPM Application served by Nginx
0
I installed Apache 2.4.37 Win64 VC15 and PHP 7.2.11 on Window 2016.  Microsoft Visual C++ 2015 Redistributable (X64).  Set up Apache, so when I go to locahost, it shows "It Works!".  However, after placing info.php with <?php phpinfo(); ?> and trying to open it, I have a blank page.

In httpd.conf, I added:
LoadModule php7_module "c:/php/php7apache2_4.dll"

<IfModule php7_module>
      AddHandler application/x-httpd-php .php
      AddType application/x-httpd-php .php .html
    PHPIniDir "c:/php"

</IfModule>

Also added to httpd.conf :

DirectoryIndex index.html index.php

In php.ini added:

extension_dir = "ext"

There C:\PHP\logs directory I created is empty.  Apache error.log shows this after each restart, but nothing else:

[Sun Oct 28 16:54:29.152004 2018] [mpm_winnt:notice] [pid 4288:tid 580] AH00422: Parent: Received shutdown signal -- Shutting down the server.
[Sun Oct 28 16:54:31.199280 2018] [mpm_winnt:notice] [pid 4156:tid 508] AH00364: Child: All worker threads have exited.
[Sun Oct 28 16:54:31.230224 2018] [mpm_winnt:notice] [pid 4288:tid 580] AH00430: Parent: Child process 4156 exited successfully.
[Sun Oct 28 16:54:34.120902 2018] [mpm_winnt:notice] [pid 2220:tid 580] AH00455: Apache/2.4.37 (Win64) PHP/7.2.11 configured -- resuming normal operations
[Sun Oct 28 16:54:34.120902 2018] [mpm_winnt:notice] [pid 2220:tid 580] AH00456: Apache Lounge VC15 Server built: Oct 18 2018 17:26:33
[Sun Oct 28 16:54:34.120902 2018] [core:notice] [pid …
0
url folder change

I have changed the folder structure slightly with moving some folders to a new folder.

eg conveyancing is now Syston/conveyancing

I have added 301 redirect which works well.

In my server files I now have the original pages ie conveyancing and ALSO Syston/conveyancing so these are duplicate, albeit with a 301 redirect.

Do I delete the duplicate pages?

Do I do a canonical tag?

If I have to retain the old pages, do I put a don't index/follow tag?


Thanks

Richard
0
Hello Experts!

I need help on how to use .htaccess to hide/remove .php from all my files and those inside folders.

I've tried to add .htaccess to the root of my folder, I could only access index.php redirected to login.php (showing login) but I couldn't move pass that page.

I was getting Page Not Found giving me wrong url.

Here is the code I've used inside .htaccess:
RewriteEngine On

# Unless directory, remove trailing slash
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/$ https://mysite.com/$1 [R=301,L]

# Redirect external .php requests to extensionless url
RewriteCond %{THE_REQUEST} ^(.+)\.php([#?][^\ ]*)?\ HTTP/
RewriteRule ^(.+)\.php$ https://mysite.com/$1 [R=301,L]

# Resolve .php file for extensionless php urls
RewriteRule ^([^/.]+)$ $1.php [L]

Open in new window

and:
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteRule ^([^\.]+)$ $1.php [NC,L]

Open in new window

Separately, both yielded same result.

Am I supposed to indicate all folders name in the .htaccess? and how?

Someone even suggested I should put .htaccess inside all folders which I tried but I couldn't login (invalid login details). After removing them (.htaccess), I was able to login again.

Please help
0
if (isset($_POST['company'])) {
$sql = "SELECT frm_id, frm_companyname, frm_contact, frm_email, frm_rep, frm_date, frm_return, frm_timefrom, frm_timeto, frm_comment1, frm_comment2, frm_comment3, frm_comment4, frm_comment5, frm_todo1, frm_todo2, frm_todo3, frm_todo4, frm_todo5, frm_updated FROM siteform WHERE frm_companyname = '$search'";
$result = $conn->query($sql);
                
if ($result->num_rows > 0) {
    // output data of each row
    while($row = $result->fetch_assoc()) {
        echo '<div class = "divechoimages">'.'<a href="'. $link .$row["frm_id"].'">Create Individual PDF</a>'.$break.'<font color="blue">' . "id:" . '<font color="purple">' .$space.$row["frm_id"]. " - Company: " . $row["frm_companyname"]. $space."Contact: " . $row["frm_contact"]. $break." email: " . $row["frm_email"]. '<font color="red">'.$break." Rep: " . $row["frm_rep"]. '<font color="green">' .$break."Date Entered: " . $row["frm_date"]. '<font color="purple">' .$break."Return Date: " . $row["frm_return"]. $break."Time From: " . $row["frm_timefrom"]. $break."Time To: " . $row["frm_timeto"]. $break."Comment1: " . $row["frm_comment1"]. $break."Comment2: " . $row["frm_comment2"]. $break."Comment3: " . $row["frm_comment3"]. $break."Comment4: " . $row["frm_comment4"]. $break."Comment5: " . $row["frm_comment5"]. $break."ToDo1: " . $row["frm_todo1"]. $break."ToDo2: " . $row["frm_todo2"]. $break."ToDo3: " . $row["frm_todo3"]. $break."ToDo4: " . $row["frm_todo41"]. $break."ToDo5: " . 

Open in new window

0
I have updated a website that has been around for a while. I checked to see what the url looks like if I search for it on Google and it is www as opposed to not having www. I wanted to keep that but also force a redirect to https as the site was http. I have added a SSL certificate so it should be https.

I have done this in the root .htaccess file, bearing in mind this is a php MVC structured project (just mentioning in case that matters at all).

<IfModule mod_rewrite.c>
 RewriteEngine on
 RewriteCond %{HTTPS} off 
 RewriteRule (.*) https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301]
 RewriteRule ^$ public/ [L]
 RewriteRule (.*) public/$1 [L]
</IfModule>

Open in new window


So, this works fine if I click on the link from the google search results and if I type www.mysite.com directly into the browser url.

But, if I just type in mysite.com then it loads the site but doesn't force the www and some things on the site do not work anymore.

Console gives me a bunch of these errors:

has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource

So, firstly, what is the best way to fix this and secondly, am I not meant to choose a preferred version and somehow state that via a canonical tag or something along those lines. I am concerned google will think there is duplicate content if both www and non www sites work or is that not an issue?

Any advice would be appreciated.
0
Exploring SQL Server 2016: Fundamentals
LVL 12
Exploring SQL Server 2016: Fundamentals

Learn the fundamentals of Microsoft SQL Server, a relational database management system that stores and retrieves data when requested by other software applications.

I'm just starting to learn Docker, and I think I have some of the basic concepts of creating containers down.  My intention is to have multiple containers on my server, each serving one unique website.

Now, here's my question.  I don't know how to handle the ports if there are multiple containers all set to respond to port 80.  Won't it cause some sort of problem if there are multiple containers, each running their own instance of apache, each reacting to port 80?  Is there some sort of internal IP addressing then that needs to take place to handle that?

I've got a pretty decent idea how the routing/responding through Apache works on a single server - but isn't this conceptually multiple servers all tied together with the same IP?
0
On a new RHEL 7.5 server, I'm trying to get mod_fcgid to run on a simple perl script. I had previously been using mod_perl on an older server, with no issues.  I have confirmed that fcgi_module is installed and running. Server is Apache 2.4.6.

httpd.conf:
AddHandler fcgid-script .fcgi

hello.fcgi:
#!/usr/bin/perl
print "Content-Type: text/html\n\n";
print "hello world";

Error log:
[Fri Oct 12 17:33:50.655808 2018] [fcgid:warn] [pid 13551] (104)Connection reset by peer: [client xxx.xxx.xxx.xxx:xxxxxxx] mod_fcgid: error reading data from FastCGI server
[Fri Oct 12 17:33:50.655891 2018] [core:error] [pid 13551] [client xxx.xxx.xxx.xxx:xxxxxx] End of script output before headers: hello.fcgi
0
301 page redirect

I am wanting to re direct

www.xxxxx(whatever)/sales to
www.xxxx(whatever)/mytown/sales

Foe SEO benefits.

I have an apache server
What would be the 301 redirect code and where on my server would it go?

ie where to upload it to?
0
Resolved most of the errors and stuck with this last one.

08-Oct-2018 21:42:28.333 INFO [main] org.apache.catalina.core.ApplicationContext.log Initializing Spring root WebApplicationContext
08-Oct-2018 21:42:32.109 SEVERE [main] org.apache.catalina.core.StandardContext.listenerStart Exception sending context initialized event to listener instance of class [org.springframework.web.context.ContextLoaderListener]
 java.lang.ArrayIndexOutOfBoundsException: 2420
      at org.springframework.asm.ClassReader.readClass(Unknown Source)
      at org.springframework.asm.ClassReader.accept(Unknown Source)
      at org.springframework.asm.ClassReader.accept(Unknown Source)
      at org.springframework.core.type.classreading.SimpleMetadataReader.<init>(SimpleMetadataReader.java:54)
      at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:80)
      at org.springframework.core.type.classreading.CachingMetadataReaderFactory.getMetadataReader(CachingMetadataReaderFactory.java:101)
      at org.springframework.core.type.classreading.SimpleMetadataReaderFactory.getMetadataReader(SimpleMetadataReaderFactory.java:76)
      at org.springframework.context.annotation.ConfigurationClassBeanDefinitionReader.checkConfigurationClassCandidate(ConfigurationClassBeanDefinitionReader.java:300)
      at org.springframework.context.annotation.ConfigurationClassPostProcessor.processConfigBeanDefinitions(ConfigurationClassPostProcessor.java:172)
      at …
0
Dear Experts

We are running web server (10.253.18.41) which is on lamp stack and database server mysql is on another server 10.253.12.42, users are complaining the application is taking too long time also on prospect conversion takes too much time and finally timeout approx 3 mins then time out , when check the network statics below is the continuous report, please let me know what does this indicate, what could be the solution

tcp        0      0 10.253.18.41:38760          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38765          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38274          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38130          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38590          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38116          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:39296          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38577          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38379          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:39027          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38827          10.253.12.42:3306           TIME_WAIT
tcp        0      0 10.253.18.41:38222          10.253.12.42:3306           TIME_WAIT
tcp        0     …
0
We have a few odd formed urls that we're trying to redirect. They all look like this but with different 5 letters after the .html, this is how I tried making the redirects work:

redirect 301 /woodinville-carpet-cleaning.html/UPfMZ/ https://andersoncarpetcleaninginc.com/professional-home-carpet-cleaning-services-woodinville/

They won't redirect though. All the normal urls in the htaccess redirect just fine, so I know there isn't an issue in the file itself. Anyone have a solution to make them redirect as we expect?

Thanks for any help.
0

Apache Web Server

19K

Solutions

14K

Contributors

The Apache HTTP Server is a secure, efficient and extensible server that provides HTTP services in sync with the current HTTP standards. Typically Apache is run on a Unix-like operating system, but it is available for a wide variety of operating systems, including Linux, Novell NetWare, Mac OS-X and Windows. Released under the Apache License, Apache is open-source software.