remove subdirectory via htaccess

Connect with other users about what to run on your webhosting (and how to run it) here.
Post Reply
Speced
New to forums
New to forums
Posts: 13
https://www.youtube.com/channel/UC40BgXanDqOYoVCYFDSTfHA
Joined: Wed Aug 07, 2013 12:14 pm
Location: Canada
Contact:

remove subdirectory via htaccess

Post by Speced »

What would be the apache rewrite for say, domain.com/other/pagestest/test.html to
  • domain.com/pagestest/test.html
    domain.com/test.html?
I tried everyone I have on google but none of them work here :(
SG-Servers.com
#RIPSingleCoreWindows
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: remove subdirectory via htaccess

Post by soja »

Code: Select all

# This allows you to redirect index.html to a specific subfolder
Redirect /index.html http://example.com/newdirectory/

# Redirect old file path to new file path
Redirect /olddirectory/oldfile.html http://example.com/newdirectory/newfile.html
:)?
Not a NFO employee
Speced
New to forums
New to forums
Posts: 13
Joined: Wed Aug 07, 2013 12:14 pm
Location: Canada
Contact:

Re: remove subdirectory via htaccess

Post by Speced »

Not trying to redirect but rather rewrite.

meaning people would type domain.com/test.html and it shows domain.com/test.html but the files are domain.com/other/pagetest/test.html
SG-Servers.com
#RIPSingleCoreWindows
User avatar
soja
This is my homepage
This is my homepage
Posts: 2389
Joined: Fri May 18, 2012 3:20 pm

Re: remove subdirectory via htaccess

Post by soja »

In that case, can't you just edit the domain on NFOs control panel to point to a specific folder?
Not a NFO employee
Post Reply