1

the issue here is that we need to remove the tilde character from the address right now looks like this:

http://192.169.198.158/~mx/

and we want to end with the same address just without the tilde character (~)

this in order to create a softlynk to point this link to our server example . com / mx /

i've found some suggestion saying that i need to insert a chunk of code into my server, one of the questions is: the code being this: RewriteEngine on

# Make the needed exceptions

RewriteCond    %{REQUEST_URI}         ^.*/icons/.*
RewriteRule    ^(.*)$                 $1           [PT,L]

RewriteCond    %{REQUEST_URI}         ^.*/error/.*
RewriteRule    ^(.*)$                 $1           [PT,L]

# Make /username work, remember: each paren is a $#, sequentially

RewriteRule    ^/([a-z0-9]+)$         /$1/         [R]
RewriteRule    ^/([a-z0-9]+)/$        /~$1/        [PT]
RewriteRule    ^/([a-z0-9]+)/(.*)$    /~$1/$2      [PT]

where do i put it? in an .htaccess file? or it has to go directly into the httpd.conf file?

thanks in advance

  • I'm pretty sure once you actually are using a domain name you won't need the tilde. Typically that is a temporary link for new sites before dns change. And all that code you copied is just random code. You shouldn't just find code and not know what it does and try to use it without understanding. http://stackoverflow.com/questions/6252471/what-is-the-use-of-tilde-in-url – Panama Jack May 26 '15 at 21:39
  • thanks, yeah i know i shouldn't use a code without not knowing what it does, and yes once i got a domain the ip address and the username (including the ~character) will go away, but, we dont have a domain the issue is that the other team will provide a softlynk named example.com/something/ they told me that i need to remove the ~ in order to creat that softlink and doesnt throw a 404 error, i hope this explains in more detail the issue, thanks in advance – Daniel Nava May 26 '15 at 21:57

1 Answers1

0

The way the rules are written, they would only work in global or <virtualhost> context because of the leading slashes on the first argument. They would not work in htaccess without modification.

covener
  • 17,402
  • 2
  • 31
  • 45