All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
64 views

How to redirect using .htaccess in Apache

I am using the following .htaccess rules to redirect the url for following conditions: RewriteEngine On RewriteCond %{HTTP_HOST} ^example\.com$ [NC] RewriteRule ^$ https://example.com/page.php [L,R=...
Bvc...'s user avatar
  • 111
2 votes
0 answers
317 views

httpd on OpenBSD: How to Redirect URLs Ending In '.php'?

I am running an httpd(8) web server on OpenBSD. php-8.1.9 is used to serve php. In /etc/httpd.conf I have the following (example.com is a placeholder for the actual domain): server "example.com&...
Matthew Carlson's user avatar
0 votes
0 answers
34 views

Two same pages www.example.com and www.example.com/index.php

Can someone help me how to fix this problem, seobility shows me that i have two same pages www.example.com and www.example.com/index.php
Branka Tomic's user avatar
0 votes
2 answers
858 views

301 redirect url based off of a category in the url

Does anyone know how to redirect a url that contains a parent category of a product? Basically I want to redirect a ton of products to a simple landing page that I created, so instead of making ...
nightcrew's user avatar
0 votes
1 answer
747 views

Apache2 : 2 php versions in the same VHOST

I am migrating my app from PHP 5.6 to php 8.0 by having a front controller redirecting to my legacy app or my new app depending on the uri. I tried with alias and it works but I need to keep the exact ...
deuterium's user avatar
2 votes
1 answer
764 views

used colons for url htaccess http://localhost/1:1

I have a problem with the colons used in url this my url http://localhost/1:1 this my htaccess RewriteEngine On RewriteRule ^/(.*):(.*) index.php/$1:$2 this error show Forbidden You don't have ...
amir shariflou's user avatar
2 votes
1 answer
635 views

Too many redirected error with Nginx on PHP

I have 2 node apps running on different ports and a PHP app. When I visit the node apps I get no errors but if I try to go to the PHP app (on /sourcebans) I get This site redirected you too many times ...
Jordan Baron's user avatar
0 votes
0 answers
573 views

nginx: Redirects URL's to extensionless pages not working on home page

I'm trying to automatically redirect pages with a PHP extension to a non extension page version e.g example.com/page.php to example.com/page. I've managed to get this working for all pages except my ...
turrican_34's user avatar
-3 votes
2 answers
43 views

One site non https

Hello I want to make sure that one file of my site is non https. I have this in my VirtualHost80 file Redirect permanent /README.php http://<ip>/README.php And I have this in my ...
John Wick's user avatar
  • 105
0 votes
1 answer
64 views

I've a wordpress website running running nginx + php7-fpm. Wordpress url redirection

My clients wordpress websites is serving many 404 requests. After checking I could see that the 404 URLs are like /wp-content/uploads/2015/8/a.png&_nc_hash=ASsvdeeknbhs and it throws 404 error. ...
Anto's user avatar
  • 139
0 votes
1 answer
765 views

Redirect all URLs without .html and set status code 301

I'm struggling wit a configuration for nginx. I have to add the .htmlsuffix to all URLs, which don't have it and do a 301 redirect to the same URL with the suffix. URLs which have the .htmlsuffix ...
kapale's user avatar
  • 405
2 votes
1 answer
4k views

Nginx rewrite rule subfolder 404 error

I cannot figure out how should I setup my index.php file with Nginx rewrite rules that it will work like example below. If I visit the url it gives me 404 error not found instad echo 'hello'. URL: ...
Ho Thanh Cyberdelia Nhan's user avatar
1 vote
1 answer
831 views

Nginx rewrite to remove .php from files has no effect but to redirect to homepage

I'm trying to make a rewrite to remove .php from my URLs but so far no luck. Here's what I've got so far and then my results with this config below. location ~ \.php$ { try_files $uri/ @...
Slbox's user avatar
  • 113
1 vote
0 answers
34 views

sending back rewrote url without forcing a new request

The user of my application issue commands (create new post, delete comment etc.) via links with nonce parameter. As this is transported via GET the URL bar contains this technical detail. I want to ...
Valerij's user avatar
  • 111
-1 votes
1 answer
972 views

Strange php redirections with nginx (Works fine in apache)

Finally I decide to ask here after hours trying, searching and researching. Months ago I migrated my site to a newer version and everything works fine with my old hosting in apache. Recently I ...
JuanDMeGon's user avatar
1 vote
1 answer
2k views

Apache SSL redirect loop [duplicate]

We are trying to redirect our site from http to https only. Everything we have tried in .htaccess has resulted in a redirect loop. If we manually type the "https://" in front of the url, our page ...
techfutures's user avatar
0 votes
1 answer
1k views

Modify the HTTP status code after PHP has finished generating a response

Does anyone know if it's possible to configure apache to modify the HTTP status code of a response after it has been generated? Basically, I have a script running under multiple host names that ...
aweraw's user avatar
  • 73
1 vote
1 answer
15k views

Nginx. Using redirects with regular expressions

I'm a newbie to nginx. I have the nginx before Apache and I'm having problems. I seem to need 2 rules in the config: Rule 1) if we have url "/my_path" we don't touch it but user goes to "/my_path....
see613's user avatar
  • 111
0 votes
1 answer
872 views

nginx and try_files confusion

I am confused with how try_files works on nginx, this needs to be done on a live production server so can't test before being 100% sure. I am using header("X-Accel-Redirect: /out/" . $fname); to ...
iTech's user avatar
  • 355
1 vote
1 answer
881 views

Porting Nginx proxy to apache virtualhost

I installed Gitlab on my server which was using Nginx at the time, but we have since switched to Apache2, and I cannot seem to get mywebsite.com:3000 to refer to /home/gitlab/gitlab/public as it did, ...
user43211's user avatar
6 votes
3 answers
6k views

.htaccess redirect all extension to php

I recently updated my .htaccess file to hide the .php extension of the urls. It works nice, when I try to reach domain.com/index, it displays the php file. When I type domain.com/index.php it ...
jameson's user avatar
  • 61
2 votes
1 answer
576 views

Trouble with mod_rewrite and PHP Extensions - Help Making the Correct .htaccess File

I'm looking for a set of simple rules and redirects for my site. I've tried so many combinations that I'm starting to get confused. I'm not sure how to set this up. Generally, without mod-rewrite, ...
nicorellius's user avatar
1 vote
1 answer
88 views

htaccess redirect from wordpress page to a php page

I have recently had to change a URL on a website (in PHP on Apache). The old URL is: http://content.mywebsite.org.uk/hidden/discounts/ When a user visits the above link. The new URL is: http://www....
Anil's user avatar
  • 262
7 votes
8 answers
5k views

Redirect all incoming mail into a script

I have no idea about Mail Delivery. but i need redirect ALL incoming e-mail (*@mydomain.com) into an a php script. i'm using debian Exists a simple mail server to do this? (without exim, postfix, ...
felix46r's user avatar
  • 261
1 vote
3 answers
2k views

How do I get my htaccess file to read a php file?

I have created a PHP file which should detect if mobile or tablet. I gleaned the following code from a web search as I don't know any coding although years ago COBOL was my breadwinner! The code in ...
user126707's user avatar
-4 votes
3 answers
1k views

.htaccess and PHP redirect hack on GoDaddy Website [duplicate]

Possible Duplicate: My server's been hacked EMERGENCY A friend is experiencing a random redirect to an RU domain for two of her websites, along with a malicious cookie attack, as per a Norton ...
delvec's user avatar
  • 1
0 votes
1 answer
255 views

Redirecting URLs using htaccess & PHP?

I would like all the URLs of the following format: mysite.com/xyz to display: mysite.com/show.php?keyword=xyz How can I do this?
Brandon's user avatar
  • 115
1 vote
2 answers
257 views

Directory Redirect on Apache Server

I downloaded a simple PHP blogging template called sphpblog and put it on my server. The blog is accessed through classlibrary.org. This domain redirects to the folder /other/william/classlibrary on ...
William's user avatar
  • 85
4 votes
3 answers
9k views

Chrome caching 302 redirects

I have a php script with is used to rotate banner images on a site. Under Firefox/IE page refreshes will make another request and a different image will be returned. Under Chrome, the request seems ...
Thermionix's user avatar
-2 votes
3 answers
1k views

.htaccess redirect to maintenance page

I want to upgrade my site online, I want to show visitors maintenance page till I finish upgrade. I tried this code Options +FollowSymlinks RewriteEngine on RewriteCond %{REQUEST_URI} !/maintenance....
Sandy Fark's user avatar
0 votes
2 answers
220 views

Apache: Redirect all hits on subdirectory (301)?

Probably a simple problem, but I cant seem to figure it out: I've recently created a new website from scratch to replace an older website. The old website had a good SEO ranking which is obviously ...
Index's user avatar
  • 121
0 votes
1 answer
3k views

Help With Infinite Redirect From .htaccess using MVC with PHP [duplicate]

Let me preface by saying that I'm fairly new to .htaccess authoring and have usually left the nitty gritty up to my hosting provider. I've recently decided to implement a hand rolled MVC framework in ...
SRM's user avatar
  • 109
1 vote
2 answers
1k views

Redirect all email sent via PHP's mail() function to single external address

I currently have php running on my desktop (OS X 10.6.7) with the ability to send emails via the mail() function by having set "relayhost" in /etc/postfix to my ISP as well having as an entry in /etc/...
Matthew Peltzer's user avatar
8 votes
7 answers
61k views

How do I make Nginx redirect all requests for files which do not exist to a single php file?

I have the following nginx vhost config: server { listen 80 default_server; access_log /path/to/site/dir/logs/access.log; error_log /path/to/site/dir/logs/error.log; root /path/to/...
Richard's user avatar
  • 856
0 votes
2 answers
2k views

Fastest loading: Redirect with header location in PHP, or Rewrite with Apache?

after becoming aware of the major lag that hits my site becaouse of the homepage redirect, i read into numerous optimization threads, proving that a 301 redirect slams out approximately 100ms to a ...
Sam's user avatar
  • 423
3 votes
4 answers
100 views

domain serves content from subdomain on another website

I have several sub-domains on 1 website http://sub1.mysite.com http://sub2.mysite.com http://sub3.mysite.com I've also registered equivalent domains for each of these sub-domains at sub1.com sub2....
user avatar
0 votes
2 answers
155 views

Apache redirect

I am trying to redirect the URL: http://www.mydomain.com/productpage.php?id=34 to http://www.mydomain.com/products I have tried using: Redirect permanent /productpage.php?id=34 http://...
Eef's user avatar
  • 103
1 vote
2 answers
176 views

Automatic server redirect that passes through as the referring site

As always, I would like to thank all of your help and assistance in advance. I am looking for a way to automatically redirect a user to a site and maintain the redirect site as the referral site. Let ...
nsearle's user avatar
  • 11
4 votes
4 answers
2k views

Transition domain to new web host without waiting for DNS propagation

I was considering switching to Amazon EC2 to host my website to handle more traffic. It seems like I would have to update DNS records to point to the new server but I was wondering if there was a way ...
jhchen's user avatar
  • 175
1 vote
2 answers
4k views

Redirect visitors to a "site in maintenance" page?

My site is in maintenance(construction). How to redirect visitors to a "site in maintenance" single page? I heard something about app_offline.htm for ASP.NET. Is there something similar for PHP? I ...
serhio's user avatar
  • 163
1 vote
4 answers
5k views

Faster Option: Redirect via PHP to PHP or Apache mod rewrite redirect to PHP?

I want to determine if using Apache's .htaccess mod rewrite is a faster way to redirect to a PHP file, compared to redirecting from one PHP file to another, using the header redirect core function of ...
r.crandall's user avatar
-1 votes
1 answer
1k views

How to stop Nginx sending static file requests to the CakePHP app controller when running Cake in a subdirectory?

I'm trying to run a CakePHP app from within a subfolder on Nginx, but the static files are not being found and are instead being passed to the app controller. Here's my current config: location /...
robotmay's user avatar
  • 115
1 vote
2 answers
301 views

Passing a URL as a varible via mod rewrite

I am trying to pass a actual url as a varible using mod_rewrite on apache I have a page externalLink.php that can be passed a url in oder to do some magic i.e. /externalLink.php?url=http://example....
Keith's user avatar
  • 125