WordPress Url Handling

Discussion in 'Web Design' started by Barber77r, Oct 28, 2010.

to remove all ads.
  1. Barber77r

    Barber77r New Member

    Messages:
    6
    Hi...

    I'm new to PHP. I have a number of Wordpress sites up and running smoothly. I want to know how Wordpress always executes index.php even via the URL http:\\www.mysite.com\2010\10\blog_title. If I attempt that on my non-wordpress php site, I get a Page Not Found error. How do they do that?

    Thanks in advance...
    Ron...
     
  2. smoovo

    smoovo New Member

    Messages:
    377
    They are using a server code, i don't know for sure what they doing, but one of the possibilities is that they are coded the .htaccess file to handle the 404 (page not found) error to direct you to the main index page.

    The code for the .htaccess file is

    HTML:
    ErrorDocument 404 /index.php
    
    It's a trick, by default there is a page contains a message for this error, but you can change this path to the main index page path. :)

    - Enjoy.

    ____________________
    [email protected]
    www.SMooVo.com – Web Design
     
  3. Barber77r

    Barber77r New Member

    Messages:
    6
    Thanks...

    I will check that out...

    Ron...
     
  4. Barber77r

    Barber77r New Member

    Messages:
    6
    smoovo...

    Thanks again for your input... I think that my Wordpress site is doing something with the .htaccess file... However, I do not seem to have access to this file or to the php5.ini file...

    Any other thoughts about handling the 404 error in any other method ?...

    Ron...
     
  5. smoovo

    smoovo New Member

    Messages:
    377
  6. Barber77r

    Barber77r New Member

    Messages:
    6
    smoovo...

    Thanks AGAIN for your input... That Redirection plugin may be useful to me in the future... But my question at hand is with my Non-Wordpress site... I would like to have the site execute index.php even when the url is something like http:\\www.mysite.com\2010\10\blog_title...

    My Wordpress site does this, but I'm not sure how - you suggested an entry in the .htaccess file - but I don't have access to this file on my GoDaddy hosted site... Any ideas?...

    You have done more for me than anyone else - so again - I thank you...
    Ron...
     
  7. smoovo

    smoovo New Member

    Messages:
    377
    My pleasure Ron. :)

    I understood you need it for your Wordpress and you just don't have access to that (with Wordpress), sorry.

    So if you have Godaddy hosting account it's very simple:
    Open notepad and copy/paste the script line i gave you, after you finish go to File > Save As... In the "Save As" window change the "Save as type" to "All Files". Name the file ".htaccess", without quotes, and without file name before the dot. Upload this file to your FTP root folder, and do test. Type some file name that doesn't exist and see if it's working (it's work like a charm). :cool:

    - Enjoy.
     

Share This Page