Hack Forums
Problem with htaccess need help - Printable Version

+- Hack Forums (https://hackforums.net)
+-- Forum: Tech (https://hackforums.net/forumdisplay.php?fid=444)
+--- Forum: Webmasters (https://hackforums.net/forumdisplay.php?fid=141)
+---- Forum: Website Construction (https://hackforums.net/forumdisplay.php?fid=50)
+---- Thread: Problem with htaccess need help (/showthread.php?tid=6261859)



Problem with htaccess need help - Dag0bertDuck - Jan 23, 2024

Hey guys a question to the pros here,

The System is running on a
Windows Server and i use Apache

i try to call the htacces file where is a other file. The problem in the error log is the Server cannot find the file. I dont know why but i need to write it down in Windows Path format like C:\example\example\file

i think the htacces dont accept "\" and in the error log it is always turned arount to "/"

cannot find file in C:/example/example/file
it rotates ->\ to ->/ and because that it cant find the path

how can i fix this ?


RE: Problem with htaccess need help - Jam1e - Jan 25, 2024

I believe even though Windows expects backslashes, you should be using forward slashes.
A few other things to double check:
- Ensure your path is using the correct case. Eg, /Users/... rather than /users/...
- If you have a space in your path like "../My Documents/...", place a backslash before the space like so: "../My\ Documents/..."


RE: Problem with htaccess need help - Dag0bertDuck - Jan 25, 2024

thanks for your help, i swapped back to linux


from my side thread can be closed here


RE: Problem with htaccess need help - Clumsy - Mar 12, 2024

RewriteEngine On
# Ensure mod_rewrite is enabled

RewriteRule ^old-directory/(.*)$ /example/example/file [L,R=301]
# Redirects all traffic from /old-directory/ to /example/example/file


RE: Problem with htaccess need help - memory - Mar 24, 2024

Can you share the specific logs?