The fuck is wrong with my htaccess?

by AUTHORITY - 27-07-2015, 08:34 PM
¯\(°_o)/¯
Posts:
6,198
Joined:
Feb 2015
Likes:
973
Credits:
53,449
Reputation:
211
3 Years of Service
#1
OP
Posted: 27-07-2015, 08:34 PM (This post was last modified: 27-07-2015, 09:17 PM by A.)
Code:
<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule ^(.*)$ /index.php/$1 [L]
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/ [R=301,L]
</IfModule>

I dont want that ugly index.php in my url (it fucks up my seo)

[Image: jZxq3.png]
Nan Ihier Gelair Mordor
Divine
Posts:
2,635
Joined:
Jan 2015
Likes:
321
Credits:
8,602
Reputation:
92
3 Years of Service
#2
Posted: 27-07-2015, 08:37 PM
Lemme guess, are you stuck on a loop?
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.
Junior Member
Posts:
63
Joined:
Jul 2015
Likes:
12
Credits:
0
Reputation:
10
2 Years of Service
#3
Posted: 27-07-2015, 08:38 PM
And what's so ugly about *.php?

RewriteRule ^(.*)$ /index/$1 [L]
Bye.
¯\(°_o)/¯
Posts:
6,198
Joined:
Feb 2015
Likes:
973
Credits:
53,449
Reputation:
211
3 Years of Service
#4
OP
Posted: 27-07-2015, 08:41 PM (This post was last modified: 27-07-2015, 08:41 PM by A.)
(27-07-2015, 08:37 PM)Sozin Wrote: Lemme guess, are you stuck on a loop?

Nope, but if someone visits my website from

domain.net/yarak

it redirects him to http://www.domain.net/index.php/yarak

Which will for sure fuck up my seo once again.

(27-07-2015, 08:38 PM)Coil Wrote: And what's so ugly about *.php?

RewriteRule ^(.*)$ /index/$1 [L]

Domain url is too long, and im worried about my seo status.
Nan Ihier Gelair Mordor
Divine
Posts:
2,635
Joined:
Jan 2015
Likes:
321
Credits:
8,602
Reputation:
92
3 Years of Service
#5
Posted: 27-07-2015, 08:51 PM
Hmm... Try this:

<IfModule mod_rewrite.c>
RewriteEngine On
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]

RewriteRule ^index\.php/(.*)$ /$1 [NC,R,L]
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.
Junior Member
Posts:
63
Joined:
Jul 2015
Likes:
12
Credits:
0
Reputation:
10
2 Years of Service
#6
Posted: 27-07-2015, 08:56 PM
(27-07-2015, 08:51 PM)Sozin Wrote: Hmm... Try this:

<IfModule mod_rewrite.c>
RewriteEngine On                  
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]        

RewriteRule ^index\.php/(.*)$ /$1 [NC,R,L]
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

I think he wants the entire "index.php" part gone?

If so, A, try this:
RewriteRule ^(.*)$ /$1 [L]

If you just want the .php part gone, try this:
RewriteRule ^(.*)$ /index/$1 [L]
Bye.
¯\(°_o)/¯
Posts:
6,198
Joined:
Feb 2015
Likes:
973
Credits:
53,449
Reputation:
211
3 Years of Service
#7
OP
Posted: 27-07-2015, 08:57 PM
(27-07-2015, 08:51 PM)Sozin Wrote: Hmm... Try this:

<IfModule mod_rewrite.c>
RewriteEngine On                  
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]        

RewriteRule ^index\.php/(.*)$ /$1 [NC,R,L]
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Redirect loop
Nan Ihier Gelair Mordor
Divine
Posts:
2,635
Joined:
Jan 2015
Likes:
321
Credits:
8,602
Reputation:
92
3 Years of Service
#8
Posted: 27-07-2015, 08:59 PM
(27-07-2015, 08:57 PM)A Wrote:
(27-07-2015, 08:51 PM)Sozin Wrote: Hmm... Try this:

<IfModule mod_rewrite.c>
RewriteEngine On                  
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]        

RewriteRule ^index\.php/(.*)$ /$1 [NC,R,L]
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Redirect loop

I don't really have any environment to test the rules. Send me your user/pass and FTP host. WILL TAKE A LOOK TOMORROW.
Do not let your difficulties fill you with anxiety, after all it is only in the darkest nights that stars shine more brightly. - Ali(a.s)

Developer( PHP, Python, C++, HTML+CSS, JS I am available for Hire. Message Me for details.
¯\(°_o)/¯
Posts:
6,198
Joined:
Feb 2015
Likes:
973
Credits:
53,449
Reputation:
211
3 Years of Service
#9
OP
Posted: 27-07-2015, 09:01 PM
(27-07-2015, 08:59 PM)Sozin Wrote:
(27-07-2015, 08:57 PM)A Wrote:
(27-07-2015, 08:51 PM)Sozin Wrote: Hmm... Try this:

<IfModule mod_rewrite.c>
RewriteEngine On                  
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]        

RewriteRule ^index\.php/(.*)$ /$1 [NC,R,L]
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Redirect loop

I don't really have any environment to test the rules. Send me your user/pass and FTP host. WILL TAKE A LOOK TOMORROW.

You always say that "I WILL TAKE A LOOK TOMORROW"
Junior Member
Posts:
63
Joined:
Jul 2015
Likes:
12
Credits:
0
Reputation:
10
2 Years of Service
#10
Posted: 27-07-2015, 09:06 PM
(27-07-2015, 09:01 PM)A Wrote:
(27-07-2015, 08:59 PM)Sozin Wrote:
(27-07-2015, 08:57 PM)A Wrote:
(27-07-2015, 08:51 PM)Sozin Wrote: Hmm... Try this:

<IfModule mod_rewrite.c>
RewriteEngine On                  
RewriteCond %{HTTP_HOST} !^www\.
RewriteRule ^(.*)$ http://www.%{HTTP_HOST}/$1 [R=301,L]        

RewriteRule ^index\.php/(.*)$ /$1 [NC,R,L]
RewriteRule ^(.*)$ /index.php/$1 [L]
</IfModule>

Redirect loop

I don't really have any environment to test the rules. Send me your user/pass and FTP host. WILL TAKE A LOOK TOMORROW.

You always say that "I WILL TAKE A LOOK TOMORROW"

Did you try the two [possible] solutions I gave you? :noh:
Bye.
The last reply on this thread is older than a month. Please do not unnecessarily bump it.
Register an account or login to reply
Create an account
Create a free account today and start posting right away. It only takes a few seconds.
Login
Log into an existing account.
1 Guest(s)