Dumb SEO Questions

(Entry was posted by João Soares on this post in the Dumb SEO Questions community on Facebook, 10/08/2013).

I removed my .php extension from the url, but this only works on localhost

Hi, I`m with one problem and I came here to ask a little help.

I`m working on web design, and recently I tried to work on friendly url`s.

I removed my .php extension from the url, but this only works on localhost.
On remote server this doesn`t work.

Any help please?

#url   #seotips
This question begins at 04:00:00 into the clip. Did this video clip play correctly? Watch this question on YouTube commencing at 04:00:00
Video would not load
I see YouTube error message
I see static
Video clip did not start at this question


Selected answers from the Dumb SEO Questions Facebook & G+ community.

  • Jim Munro: Hi ;João, you are welcome here. :)

    I am not an expert and hopefully someone skilled will pick this up but one thing you might verify in the meantime is whether the mod_rewrite module is installed on the remote server.

    Also, your .htaccess files , are they the same on both servers?
  • William Gomes: Bom Dia +João Soares ;es Tuga?

    Your rule should look something like this right?
    RewriteCond %{REQUEST_FILENAME}.php -f
    RewriteRule !.*.php$ %{REQUEST_FILENAME}.php [L, QSA]

    Also is mod_rewrite turned on, on your remote server? Thats probably the problem.
  • Matthew Stuart: Read this...


    I think the php needs to be there unless you have got a .htaccess file with mod rewrite activated, so the above link should help you. However, I have followed this a few times, and not once did I manage to get it to work... and in a few instances, I actually shut my website down :D but you just remove the .htaccess file to bring it back.

    Best of luck if you're trying this for the first time, it has been my nemesis for years!
  • João Soares: +Jim Munro ;
    Yes, the .htaccess it's the same on local and remote server
    probably it's the mod_rewrite on remote server
  • João Soares: +William Gomes ;Sim sou :)
    o meu .htaccess está assim:

    RewriteEngine on ;
    RewriteCond %{REQUEST_FILENAME} !-d ;
    RewriteCond %{REQUEST_FILENAME}.php -f ;
    RewriteRule ^(.*)$ $1.php

    Em servidor local funciona optimamente, no servidor remoto se procurar por exemplo:

    www.hi.com/hi ;

    Dá erro, diz que o ficheiro hi.php não está no servidor, no entanto ele está lá
  • João Soares: +Matthew Stuart ;Thanks for your answer, yes, i'm trying this for the first time.
    Probably it's the mod_rewrite tha's disabled on remote server but I'll check your post.
  • W.E. Jonk: From the expert panel in this weeks SEO Questions hangout on air on 04:00:00 into the YouTube video: https://dumbseoquestions.com/q/i_removed_my_php_extension_from_the_url_but_this_only_works_on_localhost

View original question in the Dumb SEO Questions community on Facebook, 10/08/2013).

All Questions in this Hangout