Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange
Join us in building a kind, collaborative learning community via our updated Code of Conduct.

A URL rewrite engine is software that modifies a web URL's appearance (URL rewriting). Rewritten URLs (sometimes known as short, fancy URLs, or search engine friendly - SEF) are used to provide shorter and more relevant-looking links to web pages. The technique adds a degree of separation between ...

1
vote
1answer
18 views

RewriteCond %{HTTPS} !=on is not working even though RewriteCond %{SERVER_PORT} !^443$ works

I have a requirement to check for non HTTPS URLs in htaccess. My understanding is that RewriteCond %{HTTPS} !=on will match all URLs that are not HTTPS. But upon testing, I find RewriteCond %{HTTPS} !...
1
vote
0answers
23 views

Error in SEO Friendly URL [closed]

I have below url structure http://example.com/blog.php?blogURL=user-already-has-more-than-max_user_connections-active-connections and I want to below http://example.com/blog/user-already-has-more-...
1
vote
0answers
9 views

How do I access the wp-admin interface of a site that lives inside a joomla folder, using IP address / siteground server URL?

For historical reasons, we have several sites that live inside the public_html folder of a different site (all hosted on sitegrounds). To complicate things up, the root domain has a name that is the ...
1
vote
1answer
31 views

www subdomain cannot be in subdirectory, how to organize files on server?

I have just switched hosting providers and stumbled across a limitation that bugs me. Previously I had the following mapping between domains and files on the webserver: example.com → /web/...
1
vote
1answer
45 views

Apache rewrite existing rewritten url [closed]

I know how to create rewrite rules in Apache but what I don't know is how to rewrite a previously rewritten url. This is an old URL /boats-for-sale/fairline-squadron-55/1280 and I need to redirect ...
3
votes
1answer
58 views

HTTPS redirect, exclude script parameters from URL

My goals: 1. http://example.com/page/index.php -> https://example.com/page/ 2. http://example.com/page/ -> https://example.com/page/ 3. http://www.example.com/page/ -> https://example.com/...
4
votes
2answers
69 views

How to force ssl and www for a subdomain as an independent domain?

I have own the example.tld . I want to force SSL and https for root-domain and all of its subdomains. I have used below code in .htaccess file of root-domain: RewriteEngine On RewriteCond %{HTTPS} ...
1
vote
1answer
81 views

IIS HTTP/S rewrite with SSL offloading non-standard local port

I posted this in a different forum and got nothing, so I'm a bit desperate. Here is my scenario: IIS running sites on 80 and 443 - external.foo.com and https://external.foo.com On the same node, a ...
1
vote
0answers
29 views

What's the best practice URL Path with multiple occurences of the same parameter?

Case User searches on a website for "cake" and filters the results via two categories: "united states" and "germany". Researched best practices SEO relevant and as short as possible URL if possible ...
1
vote
0answers
30 views

Remove non-existent language directory from URLs under nginx

I've got URLs like this: /lang/path-to-file.ext and I want to remove the "lang" because it doesn't exist: /path-to-file.ext How do I do that on an nginx server?
2
votes
1answer
30 views

Redirecting from one page to another page on my website causes 404 error after using .htaccess file

Currently I'm working on a PHP blog. Where I have used an .htaccess file to get a clean URL, here is the code: RewriteEngine On RewriteCond %{HTTPS} !=off RewriteCond %{HTTP_HOST} ^example\.com$ ...
4
votes
1answer
77 views

How to use rewrite rule to create exception rule for https redirection for directory ./well-known

Here is my situation: Server A: support.example.com -> port 80 is forwarded to this server Server B: hr.example.com Both are running apache2. For server B I want to use Let's encrypt. I want to ...
2
votes
1answer
68 views

Googlebot URLencoding longtail URLs which is causing server errors

My Google search traffic has been growing consistently for months without any hiccups. Then a few days ago, Google dropped my traffic by about 80% in one day. The traffic would then later rebound ...
4
votes
1answer
146 views

Nginx rewrite problem - displaying same page with or without .php extension after rewrite

I have implemented the following Nginx code: location / { try_files $uri $uri.php $uri/ @extensionless-php; index index.html index.htm index.php; } location ~ \.php$ { try_files $uri =...
1
vote
0answers
32 views

If I link to clean URLs based on the page title but redirect to URLS with ids as part of a site migration, is that bad for SEO?

I'm importing stuff from a Drupal site that has a couple of alias URLs: /node/123 /my-alias-node-title My new site is a very simple CMS handmade in PHP by me as a practice. In the new system, the ...
3
votes
1answer
67 views

Possible to match special characters with mod_alias and `Redirect` directive?

I’m using Apache 2.4.6 with mod_alias and have a website which is receiving traffic from a link on another website that I have no control over. The other site’s link is poorly formed and it causes ...
1
vote
0answers
24 views

Method to redirect website subfolder to new website in IIS

We currently have a website, let's call it https://supersystem.example.com We also offer customized versions of the website to clients, in the past we would throw those custom files into a sub3folder ...
1
vote
1answer
38 views

.htaccess Rewrite whole dir contents to another

I am trying to rewrite the whole contents of a directory to the home url. so, if someone visits www.example.com/bnn27sh32j@d299/gold it should take them to www.example.com/gold I have tried: ...
1
vote
1answer
195 views

How to keep question mark in URL rewriting with a GET method?

I am trying to use URL rewriting to rewrite search-en.php?q=abc to pages-afficher-recherche.php?lang_abbreviation=en&q=abc and I did RewriteRule ^search-([a-zA-Z]{2})\.php\?q\=([a-zA-Z0-9_-]*...
1
vote
1answer
163 views

Forcing trailing slash at end of “fake” folders

The working codes that I've found here most put a slash in everything. I just need force trailing slash in these "fake dirs" (that are part of my rewriting scheme (only directories)) and keep ...
0
votes
2answers
42 views

How to redirect website with SSL (HTTPS) to without SSL (HTTP)?

I have a WordPress site on a domain that used to be HTTPS, example domain https://example.com. I now want to remove HTTPS temporarily. How do I do that? I have tried to add the following to my ....
6
votes
1answer
273 views

Rewrite wildcard subdomains in .htaccess to corresponding folders on the main domain while preserving the subdomain

I'm trying to rewrite a subdomain to a folder/file like this: name.example.com -> example.com/profile/name foo.example.com -> example.com/profile/foo xyzzy.example.com -> example.com/profile/xyzzy ...
1
vote
1answer
31 views

dynamics urls - redirects or rewrite and page SERP position

I'm trying to get my head on this, our site have thousands of links, is an e-commerce site, where products titles require changes on regular basis to get the best of SEO... you know, as usual, we ...
4
votes
3answers
237 views

Rewrite to SEO friendly URLs for language negotiation with type-map files on plain html files using .htaccess

When visiting the website www.example.com/ the visitor should be redirected to the correct language version, e.g. www.example.com/en for english and www.example.com/es for spanish. My current ...
3
votes
1answer
149 views

How do I do an htaccess rewrite on an internal URL without Google crawl giving me a soft 404 error?

Here is my issue. I have a rewrite rule in my htaccess like this: RewriteRule ^(news|review|feature|editorial|podcast)/([0-9]+)/(.*)$ /article.php?id=$2 [L] Basically what it does is take in a URL ...
-1
votes
1answer
158 views

In IIS 7.5, how do you redirect an HTTPS domain to the canonical domain?

So I have a site configured with example.com:80 and www.example.com:80, as well as a certificate for port 443. When a user goes to the www.example.com:80 or 443, which has the SSL certificate ...
0
votes
1answer
86 views

How to redirect port 80 on server A to 443 server B

I'm wondering how can use my server A to redirect different URL's to the respective server. Here is my setup: Server A: apache 2.4 on ubuntu 16 Server B: apache 2.4 on windows 2012 Port 80 is ...
0
votes
1answer
36 views

Use same domain for two websites, depending on customer IP [closed]

Here's the scenario I want to know if possible and how: Scenario Domain (www.foo.com) at one hosting provider. Two websites, one at www.bar.com and another one at www.biz.com, each at a different ...
0
votes
1answer
42 views

htaccess rewrite url

is it possible to create a 301 redirect for the following URL string: Original URL: http://www.example.com/old/old-directory/blog-post-1.html Desired destination URL: http://www.example.com/new/new-...
3
votes
1answer
81 views

blog/index.php/author/ how to create this kind of a URL for my php page?

WordPress blog URL has this notation. chapter .php there is another path. it is not an actual existing directory on the server. my question is how they do that? can I do something like that on my ...
2
votes
0answers
327 views

How to use .htaccess rewrite rules to remove .php and folders from URLs?

I'm trying to simplify the URLs using rewrite condtions and rules on my local WAMP website. For example I would like to have /ProjetSyntheseFAC/mammiferes instead of /ProjetSyntheseFAC/pages/animaux/...
3
votes
2answers
57 views

How to correctly update a Wordpress URL?

I have a WordPress website which has a lot of very well position URL but unfortunately, they all have the id on the URL instead of a friendly URL. I am working on a new website but I will like to ...
1
vote
1answer
891 views

How do I use URL redirection with reverse proxy?

My requirement is to redirect the URL, which is running on port 80 with reverse proxy. I guess I would have to use URL redirection, reverse proxy together. There is already a web-domain active like : ...
2
votes
2answers
67 views

.htaccess RewriteRule leading to unexpected page

I'm trying to do a simple invisible redirection with .htaccess which almost work. I'd like my main domain name example.com to access the content of the folder example.com/V8/ but keeping only the ...
0
votes
2answers
144 views

Do URL parameters create different URLs from Google's SEO perspective?

I have the following 4 URLs. Are all these the same URL or different URLs from Google's SEO perspective? (Having a different query string makes it another URL?) https://www.example.com/buy-web-...
2
votes
1answer
80 views

URL rewrite problem on IIS7.5

My aim is to create Friendly URLs for a website hosted on IIS 7.5. The site has 3 pages with the following URLs: http://www.example.com/contact.php?langid=1&title=contact http://www.example.com/...
1
vote
3answers
80 views

Will shortening a URL hurt my SEO?

Will I mess up my SEO if I remove a part of my URL, even if it still takes you to the same page? An example is: example.com/services/nc/clt/charlotte-nc/... And I want to take out the "services" ...
2
votes
2answers
2k views

How to remove subdirectory folders from the url using htaccess

I am trying to remove the sub-folders from my site URL. Below is the structure of my folders. I am not sure where to place my .htaccess file and what to have written in it: mysiteroot ...
1
vote
0answers
131 views

IIS showing 404 error for CakePHP routing prefixes for instance located in subfolder

I have this Single Page Application built using AngularJS that resides in the document root. The SPA communicates with an API built using CakePHP 3.5.x. The CakePHP instance resides in a folder named ...
0
votes
0answers
32 views

Nginx rewrite for wp-includes works but not the one for content/uploads

I want to perform a few rewrites: this actually works: rewrite ^/includes/(.*) /wordpress/wp-includes/$1?putyo_happybits=administrator last; and I get this: http://everhide.wordpress.dev/includes/...
2
votes
1answer
68 views

Enabling Multiviews is how you make a web server able to open links with missing extensions?

I'm in the process of switching web hosts. My old host was of the beginner-friendly 'kid gloves' variety. I had less control, but it took care of a lot of things behind the scenes. My new web host ...
3
votes
1answer
2k views

Nginx: set Content-Type by URI problem

I'm setting up small personal file hosting, I made a backend to store uploaded files by their hash directly on the HDD like /f/ab/cd/ef012345678..., but without file extensions and generate an URI ...
2
votes
1answer
36 views

Asked to authenticated WebDav twice when connecting to HTTPS

I'm having the problem of double authentification on my Apache server like he has: Properly Force SSL with .htaccess But I want to do this via the conf files. He says he knows how to do it via conf ...
2
votes
0answers
84 views

.htaccess to show a page from the main site on another domain

I have 2 x domain names https://www.example.com - This is my main site. http://www.example-liverpool.com This is my Liverpool sub website example.com/liverpool I've presently got URL forwarding ...
0
votes
2answers
545 views

Apache .htaccess: Is it possible to write an if condition for a cookie value check?

I want to write an if condition in an .htaccess file to check whether a cookie value is set. Example code: <If "%{HTTP_COOKIE} == 'cookiename and value'"> ... </If>
1
vote
2answers
35 views

Rename translated documents into ending language initials

I am building a web app and trying to add two languages to the website. So I will make the same documents ending in -gr. Some examples of the files look like this: English Language paths: www....
0
votes
0answers
6 views

How to properly use keywords with get urls [duplicate]

I have a website with a list of products for which I am using $_GET in php. This way i dynamically generate the page content based on the id of the category in the url. I have a category and then a ...
1
vote
1answer
52 views

What is a rewrite rule to add a prefix directory for a specific set of pages (dozens)

I have some pages on a Wordrpress site as www.example.com/title-of-the-page For my SEO activities I would like to add a prefix to those pages. They will be www.example.com/name-of-the-prefix/title-of-...
1
vote
1answer
72 views

Use .htaccess to make pretty URLs that expand abbreviation codes

Yes, I know, there are tons of questions like this, but I can't find one which solves my problem so at cost of receiving downvotes I'm going to ask this again. Even a duplicate link may help me. This ...
3
votes
1answer
77 views

Is it a Good Practice to move a blog from HTTP to HTTPS?

I have an e-commerce that is on https://www.example.com/, and I have a blog on the same URL, and it is on http://www.example.com/myblog/. Now, according to Google's guidelines, they are giving more ...