Tilted Forum Project Discussion Community

Tilted Forum Project Discussion Community (https://thetfp.com/tfp/)
-   Tilted Technology (https://thetfp.com/tfp/tilted-technology/)
-   -   page redirect question (https://thetfp.com/tfp/tilted-technology/76710-page-redirect-question.html)

irateplatypus 11-21-2004 09:45 PM

page redirect question
 
first time to post in the programming forum.

if my website is located at "www.mydomain.com" how would i get it to default to a page that isn't located at the root?

so if the file i want displayed when people type "www.mydomain.com" is actually stored in "www.mydomain.com/randomfile/", what is the most effective way to do that? is there a way?

i apologize if this question has a ridiculously easy answer. i've done a few google searches but nothing answers my question specifically.

maestroxl 11-21-2004 10:29 PM

The low-tech way is to add the following tag to the -head- of your current default page:
<meta http-equiv="Refresh" content="0; URL=http://www.mydomain.com/randomfile/"> (The zero, if you didn't know, is the number of seconds you want the browser to display the current page before redirecting. Zero would tell the browser to redirect immediately, but the actual speed depends on a number of factors, so the page content might display briefly. You can always display the link as well on the page.)

Anything more complicated than that either requires a scripting language (coldfusion, asp, jsp...) or a configuration at the web server that handles the redirect. Hope that helps.

theFez 11-21-2004 11:28 PM

you can also easily do this with php or javascript. but keep in mind, you should have a good reason for this especially if you rely on or desire search engine listings because many search engines penalize you for automatic redirects.

The best solution is to move your landing page to web root or to modify your webserver configuration to point to the desired page.

irateplatypus 11-21-2004 11:58 PM

wow, two worthy responses in less than 2 hours. that's why i love TFP.

i wanted to keep the start page off the root for simplicity in the actual file structure and a strange desire to keep whatever i can off the root directory borrowed from areas in computing where i am much more knowledgeable.. the site just a personal one done for family reasons... so i'm sure they'll forgive me for a redirect. however, when commercial sites do this it does annoy me a bit.

i really should just knuckle down and get a scripting language like php under my belt.

thanks again for the two answers. please add more to the discussion if anything comes to mind.

welshbyte 11-22-2004 07:37 PM

Unless you control this behaviour directly at the webserver, you're leaving it up to the user's browser to decide whether they want to observe the redirect or not.

Personally, my web host offers a good menu selection options screen where i can set this behaviour at the web server level. (In case you're wondering, it just adds/changes a line to a config file in a specific directory on the server). If however you have direct access to the web server then you may want to read up on how to configure it. Search online and you should find some great tutorials, FAQ's, walkthroughs, etc. You'll find this a much more powerful way to do things so i hope you do have this option open to you.

Welcome to tilted programming :)

theo5222 11-22-2004 09:55 PM

I will usually set up a redirect default.asp page. This way I can call a redirect to any directory on my site that I want.

response.redirect "[pagename]"


All times are GMT -8. The time now is 04:42 PM.

Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Search Engine Optimization by vBSEO 3.6.0 PL2
© 2002-2012 Tilted Forum Project


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360