Search…

X3 Photo Gallery Support Forums

Search…
 
metallissimus
Experienced
Topic Author
Posts: 331
Joined: 17 Oct 2019, 06:54

301 redirect results in strange URL

26 Feb 2020, 06:57

I changed a page name from uppercase (which I came to learn I shouldn't have used in the first place) to lowercase and wanted to redirect it with the following line in htaccess:
Code
Redirect 301 /Ueber/    https://www.danielbollinger.de/ueber/
It works in principal, but I end up with a strange URL showing in the browser: https://www.danielbollinger.de/ueber/?/Ueber/

I guess it has something to do with the other rules defined by X3, but I don't know enough about mod_rewrite to really  understand what's going on there.
www.danielbollinger.de – corporate photography
hochzeiten.danielbollinger.de – wedding photography
 
User avatar
mjau-mjau
X3 Wizard
Posts: 13993
Joined: 30 Sep 2006, 03:37

Re: 301 redirect results in strange URL

26 Feb 2020, 10:05

This was added at the beginning or end of the X3 .htaccess file? Try to change the rule location? There are several reasons that could happen, and yes it could be related to the X3 rules. You will find many topics on about this on Google search "redirect appends old url to new url", but an easier way to solve this is to use X3's own link/redirect mechanism:
  1. Delete the rule from .htaccess.
  2. Create a NEW page in X3 with the OLD URL /Ueber/ (empty content).
  3. HIDE the new /Ueber/ folder (click the hide button).
  4. Go to /Ueber/ page Settings > Link > Link URL, set it to /ueber/.
    Image
X3 app will now redirect /Ueber/ to /ueber/ without depending on .htaccess rule.
 
metallissimus
Experienced
Topic Author
Posts: 331
Joined: 17 Oct 2019, 06:54

Re: 301 redirect results in strange URL

26 Feb 2020, 11:11

Thank you very much! Because of the search term you suggested I found a working solution here: https://stackoverflow.com/questions/366 ... url-to-new

That page was only one example of many pages I changed and I don't want to cluster my folder tree with lots of hidden pages, so I prefer the htaccess solution.
www.danielbollinger.de – corporate photography
hochzeiten.danielbollinger.de – wedding photography