All Questions
43
questions
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=...
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&...
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
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 ...
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 ...
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 ...
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 ...
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 ...
-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 ...
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. ...
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 ...
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:
...
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/ @...
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 ...
-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 ...
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 ...
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 ...
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....
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 ...
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, ...
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 ...
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, ...
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....
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, ...
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 ...
-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 ...
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?
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 ...
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 ...
-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....
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 ...
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 ...
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/...
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/...
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 ...
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....
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://...
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 ...
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 ...
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 ...
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 ...
-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 /...
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....