1

I am trying to get clean URL's for SEO purpose. I have never done this before and I got It working for the simple file's inside my page folder.

However I have a other folder inside my page folder called folder b

My messy URL(inside page folder): index.php?page=

Messy URL from folder b: index.php?page=folderb/file

I got a clean URL from the page folder. But from my pages in folder b I don't get it to work.

I already tried adding a other .htaccess file to my folder b folder and override the root .htaccess

I tried to domainname/folderb/nameFile in my navbar.

All the things that I tried I got a 404 page

My .htaccess file

RewriteEngine On

RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^([^/]+)/?$ index.php?page=$1 [L,QSA]

RewriteCond %{THE_REQUEST} ^[A-Z]{3,}\s/+index\.php\?page=([^\s]+) [NC]
RewriteRule ^ %1? [R=301,L]

I expect to get a clean url from my folder b that's inside my page folder.

duc mai
  • 1,412
  • 2
  • 10
  • 17
J_P
  • 189
  • 1
  • 2
  • 12
  • You need to make sure all your links are absolute, e.g. `/foo/bar` instead of `foo/bar` - otherwise they won't use if you are inside e.g. `/foo/` – ThiefMaster Nov 09 '19 at 10:45
  • my links are like this domainName/folderB/pageInFolderB/ or do you mean in the .htaccess file? I think my .htacces is wrong because the .htaccess expect to have only 1 variable after page= but I am not sure how to fix this. – J_P Nov 09 '19 at 19:06
  • can anyone help me? – J_P Nov 10 '19 at 14:43

1 Answers1

0

Okay so I gave it another try and I went only worse I got this error message

Bad Request Your browser sent a request that this server could not understand. Reason: You're speaking plain HTTP to an SSL-enabled server port. Instead use the HTTPS scheme to access this URL, please.

And It seems I cant turn this back. It doesnt mather if I switch to my old .htaccess and change the URL in my header.php

My other page's are working but all the pages in domainName/home/Server/https/fastcgi/rid/54/26/59315426/htdocs/folderB/file

J_P
  • 189
  • 1
  • 2
  • 12