-1

I have this code in my .htaccess (default of my PHP site) and would like to redirect my users when accessing by cell, for a specific URL.

<IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{REQUEST_URI} !^public
    RewriteRule ^(.*)$ public/$1 [L]

    RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC]
    RewriteCond %{REQUEST_URI} ^/$
    RewriteRule ^ http://pipocaplayfm.com/new-releases%{REQUEST_URI} [R,L]
</IfModule>
  • Did you just copy the answer into the question? I think you may be misunderstanding how this site works; have you read through the [tour] and introduction pages in the [help]? – IMSoP Nov 02 '17 at 12:46

1 Answers1

0

Try this one.

RewriteEngine On
# Check for mime types commonly accepted by mobile devices
RewriteCond %{HTTP_ACCEPT} "text\/vnd\.wap\.wml|application\/vnd\.wap\.xhtml\+xml" [NC]
RewriteCond %{REQUEST_URI} ^/$
RewriteRule ^ http://m.domain.com%{REQUEST_URI} [R,L]

for more info check this topic.

http://www.inmotionhosting.com/support/website/redirects/mobile-redirect

Or check this answer for php code to do this.

https://stackoverflow.com/a/13109951/7387742

Mohammed Alhanafi
  • 886
  • 1
  • 9
  • 22
  • is that correct? (I edited the question with the code that I put along with yours) I do not have so much knowledge. I put it like this, but it was not directed to that page that was configured. I'm trying to just leave a different home page (in this case it would be http://pipocaplayfm.com/new-releases) when accessing the mobile. – jhonatan santos Nov 02 '17 at 12:43
  • @jhonatan santos, try the whole code instead of your code. – Mohammed Alhanafi Nov 02 '17 at 13:23
  • If I just use the suggested code it goes out of the air the site. – jhonatan santos Nov 02 '17 at 21:46